Browse Source

删除list缓存数据

wangbin 3 years ago
parent
commit
5655b4400b
1 changed files with 10 additions and 2 deletions
  1. 10 2
      service/log/log_statistics.go

+ 10 - 2
service/log/log_statistics.go

@@ -551,7 +551,7 @@ func (s *ServiceStatisticsLog) CreateComputerStatisticsData() {
 		return
 	}
 	var csReplys []*log.LogComputer
-	for code, r := range codeMps {
+	for code, _ := range codeMps {
 		// 不统计不在电脑列表里的
 		if _, ok := computerData[code]; !ok {
 			continue
@@ -572,6 +572,7 @@ func (s *ServiceStatisticsLog) CreateComputerStatisticsData() {
 		if err != nil {
 			continue
 		}
+		operator := computerData[code]
 		delete(computerData, code)
 		for gameId, num := range accountMps {
 			csReply := new(log.LogComputer)
@@ -579,7 +580,7 @@ func (s *ServiceStatisticsLog) CreateComputerStatisticsData() {
 			if _, ok := onlineComputerMpa[csReply.PcCode]; ok {
 				delete(onlineComputerMpa, csReply.PcCode)
 			}
-			csReply.Operator = r
+			csReply.Operator = operator
 			data, err := global.GVA_REDIS.HGet(ctx, key, gameId).Result()
 			if err != nil {
 				if err == redis.Nil {
@@ -1163,6 +1164,13 @@ func (s *ServiceStatisticsLog) RegularDelCheckData() {
 	s.LogicalLog.DelHashUuidKey(ctx, date)
 	s.LogicalLog.DelZSetKey(ctx, date)
 	s.LogicalLog.DelHashKey(ctx, date)
+	s.DelListKey(ctx, date)
+}
+
+// 删除list缓存数据
+func (s *ServiceStatisticsLog) DelListKey(ctx context.Context, date string) {
+	key := fmt.Sprintf(failCacheKey, date)
+	global.GVA_REDIS.Del(ctx, key)
 }
 
 // @author: [piexlmax](https://github.com/piexlmax)