|
@@ -9,9 +9,14 @@ import (
|
|
|
//record more information
|
|
|
func IndexAutoRefresh(filePath string) bool {
|
|
|
if global.Re == nil {
|
|
|
- err := global.Rc.LPush(utils.REFRESH_INDEX, filePath)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("RecordNewLogs LPush Err:" + err.Error())
|
|
|
+ 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 true
|
|
|
}
|