| | |
| | | logger.Error(err) |
| | | return |
| | | } |
| | | logger.Debugf("获取%d条人员信息", len(dbPersons)) |
| | | logger.Debugf(" eachNum:%d, 获取%d条人员信息", queryEachNum, len(dbPersons)) |
| | | CacheMap.Lock() |
| | | |
| | | areaId := "" |
| | |
| | | logger.Error(err) |
| | | return |
| | | } |
| | | if info.Tableid != "" { |
| | | if info != nil && info.AreaId != "" { |
| | | CacheMap.Lock() |
| | | defer CacheMap.Unlock() |
| | | if _, ok := CacheMap.Area[info.Tableid]; !ok { |
| | | CacheMap.Area[info.Tableid] = shardmap.New(uint8(*threadnum)) |
| | | if _, ok := CacheMap.Area[info.AreaId]; !ok { |
| | | CacheMap.Area[info.AreaId] = shardmap.New(uint8(*threadnum)) |
| | | } |
| | | CacheMap.Area[info.Tableid].Set(info.Id, info) |
| | | CacheMap.Area[info.Tableid].Settime() |
| | | CacheMap.Area[info.AreaId].Set(info.Id, info) |
| | | CacheMap.Area[info.AreaId].Settime() |
| | | } |
| | | } |
| | | |