소스 검색

刷新京博的彭博月度年度等数据

xyxie 1 년 전
부모
커밋
74d01a2b29
2개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      services/data/edb_info.go
  2. 5 0
      utils/config.go

+ 7 - 1
services/data/edb_info.go

@@ -137,7 +137,13 @@ func RefreshDataFromPb(wg *sync.WaitGroup) (err error) {
 	}()
 	var condition string
 	var pars []interface{}
-	condition += " AND source=? AND frequency in ('日度','周度') "
+	var frequencyStr string
+	if utils.PbRefreshFrequency == "" {
+		frequencyStr = "'日度','周度'"
+	} else {
+		frequencyStr = utils.PbRefreshFrequency
+	}
+	condition += " AND source=? AND frequency in (" + frequencyStr + ") "
 	pars = append(pars, utils.DATA_SOURCE_PB)
 
 	items, err := data_manage.GetEdbInfoByCondition(condition, pars, 0)

+ 5 - 0
utils/config.go

@@ -115,6 +115,8 @@ var (
 	AccessKeySecret  string
 )
 
+// 彭博更新频度
+var PbRefreshFrequency string
 var HzDataApi string
 
 func init() {
@@ -242,4 +244,7 @@ func init() {
 	if HzDataApi == "" {
 		HzDataApi = "https://hzdataapi.hzinsights.com/hzdataapi/"
 	}
+
+	// 彭博刷新频度
+	PbRefreshFrequency = config["pb_refresh_frequency"]
 }