index_cache.go 483 B

123456789101112131415161718192021222324
  1. package cache
  2. import (
  3. "fmt"
  4. "hongze/mysteel_watch/global"
  5. "hongze/mysteel_watch/utils"
  6. )
  7. //record more information
  8. func IndexAutoRefresh(filePath string) bool {
  9. if global.Re == nil {
  10. if global.Rc != nil {
  11. if global.Rc.SetNX(filePath,filePath,utils.GetTodayLastSecond()){
  12. err := global.Rc.LPush(utils.REFRESH_INDEX, filePath)
  13. if err != nil {
  14. fmt.Println("RecordNewLogs LPush Err:" + err.Error())
  15. }
  16. return true
  17. }
  18. }
  19. return true
  20. }
  21. return false
  22. }