tuoling805 il y a 1 an
Parent
commit
e118d261ec
2 fichiers modifiés avec 4 ajouts et 16 suppressions
  1. 2 2
      services/index.go
  2. 2 14
      watch/edb_lib.go

+ 2 - 2
services/index.go

@@ -185,7 +185,7 @@ func IndexRefreshAll() {
 	//indexObj := new(index.BaseFromMysteelChemicalIndex)
 	//list, err := indexObj.GetIndexRefreshAllByMergeFile()
 	frequency := global.CONFIG.Serve.Frequency
-	list, err := watch.GetIndexRefreshAllByMergeFile(frequency)
+	list, err := watch.GetIndexRefreshAllByMergeFile()
 	if err != nil {
 		fmt.Println("GetIndexRefreshAll Err:" + err.Error())
 		return
@@ -217,7 +217,7 @@ func IndexRefreshAll() {
 				//MysteelChemicalRefresh(v.MergeFilePath)
 				AddIndexRefreshToLpush(v.MergeFilePath)
 			}
-		} else if v.Frequency == "周度" {
+		} else if v.Frequency == "周度" && frequency == "周度" {
 			if week > 2 && week < 6 {
 				//MysteelChemicalRefresh(v.MergeFilePath)
 				AddIndexRefreshToLpush(v.MergeFilePath)

+ 2 - 14
watch/edb_lib.go

@@ -269,12 +269,8 @@ func GetIndexCreate() (items []index.BaseFromMysteelChemicalIndex, err error) {
 	return
 }
 
-type IndexRefreshReq struct {
-	Frequency string
-}
-
 // GetIndexRefreshAllByMergeFile 获取全部刷新所需文件
-func GetIndexRefreshAllByMergeFile(frequency string) (items []index.BaseFromMysteelChemicalIndex, err error) {
+func GetIndexRefreshAllByMergeFile() (items []index.BaseFromMysteelChemicalIndex, err error) {
 	if global.CONFIG.Serve.EdbLibUrl == `` {
 		err = errors.New("刷新未配置")
 		return
@@ -283,15 +279,7 @@ func GetIndexRefreshAllByMergeFile(frequency string) (items []index.BaseFromMyst
 	baseUrl := "/mysteel_chemical/query/refresh"
 	url := fmt.Sprint(global.CONFIG.Serve.EdbLibUrl, baseUrl)
 
-	req := new(IndexRefreshReq)
-	req.Frequency = frequency
-
-	postData, err := json.Marshal(req)
-	if err != nil {
-		return
-	}
-
-	result, err := HttpPost(url, string(postData), "application/json")
+	result, err := HttpPost(url, "", "application/json")
 	if err != nil {
 		return
 	}