fix: add role limit
This commit is contained in:
@@ -48,7 +48,10 @@ func cacheNCovStatistics() {
|
||||
var nCovRes map[string]string
|
||||
json.Unmarshal([]byte(resp), &nCovRes)
|
||||
var nCovResData map[string]interface{}
|
||||
json.Unmarshal([]byte(nCovRes["data"]), &nCovResData)
|
||||
err := json.Unmarshal([]byte(nCovRes["data"]), &nCovResData)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if !needToRecache(nCovResData) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ func GetAllCityData(sort string) []interface{} {
|
||||
}
|
||||
|
||||
func GetCountryData(child bool) []interface{} {
|
||||
checkCache()
|
||||
if child {
|
||||
return getEntireRedisList(rds_COUNTRY_LEVEL_CHILD_KEY)
|
||||
}
|
||||
@@ -43,6 +44,7 @@ func GetCountryData(child bool) []interface{} {
|
||||
}
|
||||
|
||||
func GetChinaNCovStatistic() models.ChinaData {
|
||||
checkCache()
|
||||
data := models.ChinaData{}
|
||||
json.Unmarshal([]byte(global.Redis.Get(rds_CHINA_ADD_KEY).Val()), &data.ChinaAdd)
|
||||
json.Unmarshal([]byte(global.Redis.Get(rds_CHINA_TOTAL_KEY).Val()), &data.ChinaTotal)
|
||||
|
||||
Reference in New Issue
Block a user