1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package services
- import (
- "eta_gn/eta_api/services/data"
- "eta_gn/eta_api/utils"
- "fmt"
- "strings"
- )
- func Task() {
- fmt.Println("task start")
- //手工数据表格导入后的指标库刷新
- go ImportManualDataRefresh()
- // 指标刷新
- go data.HandleEdbRefreshQueue()
- // 进行指标替换操作
- go DealReplaceEdbCache()
- fmt.Println("task end")
- }
- // ImportManualDataRefresh 导入手工数据后的刷新
- func ImportManualDataRefresh() {
- defer func() {
- if err := recover(); err != nil {
- fmt.Println("[ImportManualDataRefresh]", err)
- }
- }()
- for {
- utils.Rc.Brpop(utils.CACHE_IMPORT_MANUAL_DATA, func(b []byte) {
- edbCode := string(b)
- edbCode = strings.TrimPrefix(edbCode, `"`)
- edbCode = strings.TrimSuffix(edbCode, `"`)
- data.RefreshManualData(edbCode)
- })
- }
- }
|