fix: 优化数据看板更新逻辑

This commit is contained in:
CaIon
2024-01-07 18:33:41 +08:00
parent bf8794d257
commit ce05e7dd86
2 changed files with 10 additions and 7 deletions

View File

@@ -17,11 +17,13 @@ type QuotaData struct {
Quota int `json:"quota" gorm:"default:0"`
}
func UpdateQuotaData(frequency int) {
func UpdateQuotaData() {
for {
common.SysLog("正在更新数据看板数据...")
SaveQuotaDataCache()
time.Sleep(time.Duration(frequency) * time.Minute)
if common.DataExportEnabled {
common.SysLog("正在更新数据看板数据...")
SaveQuotaDataCache()
}
time.Sleep(time.Duration(common.DataExportInterval) * time.Minute)
}
}