Explorar o código

恢复煤炭江湖

xyxie hai 3 meses
pai
achega
c4429ca62f
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      services/mtjh_watch.go

+ 5 - 2
services/mtjh_watch.go

@@ -5,7 +5,10 @@ import (
 	"fmt"
 	"github.com/patrickmn/go-cache"
 	"io/fs"
+	"os"
 	"path/filepath"
+	"strings"
+	"syscall"
 	"time"
 )
 
@@ -26,7 +29,7 @@ func mtjhWatch() {
 			return err
 		}
 		if !info.IsDir() {
-			/*fileInfo, err := os.Stat(path)
+			fileInfo, err := os.Stat(path)
 			if err != nil {
 				fmt.Println("os.Stat:", err.Error())
 			}
@@ -47,7 +50,7 @@ func mtjhWatch() {
 				}
 			}
 			cacheClient.Delete(path)
-			cacheClient.Set(path, modifyTimeStr, 24*time.Hour)*/
+			cacheClient.Set(path, modifyTimeStr, 24*time.Hour)
 		}
 		return nil
 	})