1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- package services
- import (
- "eta/mysteel_watch/cache"
- "fmt"
- "time"
- )
- func AutoRefresh() {
- for {
- el := cache.RefreshList.Front()
-
- if el == nil {
- time.Sleep(1 * time.Second)
- continue
- }
- filePath := el.Value.(string)
- IndexHandle(filePath)
-
- cache.RefreshList.Remove(el)
- cache.FilePathMutex.Lock()
- delete(cache.FilePathMap, filePath)
- cache.FilePathMutex.Unlock()
- }
- }
- func IndexHandle(filePath string) {
-
- fmt.Println("开始刷新文件:", filePath)
- time.Sleep(1 * time.Second)
- MysteelChemicalRefresh(filePath)
- }
|