12345678910111213141516171819202122232425262728293031323334353637 |
- package cache
- import (
- "context"
- "fmt"
- "hongze/mysteel_watch/global"
- )
- // record more information
- //func IndexAutoRefresh(filePath string) bool {
- // if global.Re == nil {
- // if global.Rc != nil {
- // if global.Rc.SetNX(filePath, filePath, utils.GetTodayLastSecond()) {
- // err := global.Rc.LPush(utils.REFRESH_INDEX, filePath)
- // if err != nil {
- // fmt.Println("RecordNewLogs LPush Err:" + err.Error())
- // }
- // return true
- // }
- // }
- // return false
- // }
- // return false
- //}
- func IndexAutoRefresh(filePath string) bool {
- channel := `autoRefresh`
- if global.Redis != nil {
- err := global.Redis.Publish(context.TODO(), channel, filePath).Err()
- if err != nil {
- fmt.Println("Redis.Publish Err:" + err.Error())
- return false
- }
- return true
- }
- return false
- }
|