|
@@ -55,7 +55,8 @@ func IndexCreateCheck() (err error) {
|
|
|
go alarm_msg.SendAlarmMsg(utils.APPNAME+" 指标数据未生成检测失败:"+err.Error()+";file:"+v.FilePath, 3)
|
|
|
}
|
|
|
time.Sleep(1 * time.Second)
|
|
|
- MysteelChemicalRefresh(v.FilePath)
|
|
|
+ //MysteelChemicalRefresh(v.FilePath)
|
|
|
+ AddIndexRefreshToLpush(v.FilePath)
|
|
|
} else {
|
|
|
fmt.Println("IndexCreate:" + v.IndexCode)
|
|
|
saveFilePath, err := IndexCreate(v)
|
|
@@ -67,7 +68,8 @@ func IndexCreateCheck() (err error) {
|
|
|
fmt.Println("IndexCreate saveFilePath:" + v.FilePath)
|
|
|
time.Sleep(1 * time.Second)
|
|
|
if utils.FileIsExist(saveFilePath) {
|
|
|
- MysteelChemicalRefresh(saveFilePath)
|
|
|
+ //MysteelChemicalRefresh(saveFilePath)
|
|
|
+ AddIndexRefreshToLpush(saveFilePath)
|
|
|
}
|
|
|
fmt.Println("MysteelChemicalRefresh end:" + v.IndexCode)
|
|
|
}
|
|
@@ -194,23 +196,28 @@ func IndexRefreshAll() {
|
|
|
time.Sleep(time.Duration(rn) * time.Second)
|
|
|
if v.Frequency == "年度" {
|
|
|
if month == 1 && day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "季度" {
|
|
|
if (month == 1 || month == 4 || month == 7 || month == 10) && day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "月度" {
|
|
|
if day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "周度" {
|
|
|
if week > 2 && week < 6 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else {
|
|
|
if week < 6 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -239,23 +246,28 @@ func IndexRefreshMethanol() {
|
|
|
time.Sleep(3 * time.Second)
|
|
|
if v.Frequency == "年度" {
|
|
|
if month == 1 && day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "季度" {
|
|
|
if (month == 1 || month == 4 || month == 7 || month == 10) && day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "月度" {
|
|
|
if day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "周度" {
|
|
|
if week > 2 && week < 6 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else {
|
|
|
if week < 6 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -288,23 +300,28 @@ func IndexRefreshTimely() {
|
|
|
time.Sleep(3 * time.Second)
|
|
|
if v.Frequency == "年度" {
|
|
|
if month == 1 && day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "季度" {
|
|
|
if (month == 1 || month == 4 || month == 7 || month == 10) && day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "月度" {
|
|
|
if day == 1 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else if v.Frequency == "周度" {
|
|
|
if week > 2 && week < 6 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
} else {
|
|
|
if week < 6 {
|
|
|
- MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ //MysteelChemicalRefresh(v.MergeFilePath)
|
|
|
+ AddIndexRefreshToLpush(v.MergeFilePath)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -415,3 +432,12 @@ func GetComment(filePath string) string {
|
|
|
}
|
|
|
return ""
|
|
|
}
|
|
|
+
|
|
|
+var pushLock sync.RWMutex
|
|
|
+//刷新周度指标数据
|
|
|
+func AddIndexRefreshToLpush(filePath string) {
|
|
|
+ pushLock.Lock()
|
|
|
+ cache.IndexAutoRefresh(filePath)
|
|
|
+ pushLock.Unlock()
|
|
|
+ return
|
|
|
+}
|