1234567891011121314151617181920212223242526272829303132 |
- package services
- import (
- "fmt"
- "hongze/mysteel_watch/global"
- "hongze/mysteel_watch/utils"
- "time"
- )
- // the service for log
- func AutoRefresh() {
- defer func() {
- if err := recover(); err != nil {
- fmt.Println("[AutoRefresh]", err)
- }
- }()
- for {
- global.Rc.Brpop(utils.REFRESH_INDEX, func(b []byte) {
- filePath := string(b)
- IndexHandle(filePath)
- })
- }
- }
- func IndexHandle(filePath string) {
- //err := UpdateComment(filePath)
- //if err != nil {
- // go alarm_msg.SendAlarmMsg(utils.APPNAME+" 指标数据未生成检测失败:"+err.Error()+";file:"+filePath, 3)
- //}
- time.Sleep(1 * time.Second)
- MysteelChemicalRefresh(filePath)
- }
|