12345678910111213141516171819202122232425262728293031323334353637 |
- 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")
- }
- 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)
- })
- }
- }
|