zhangjinkun 6 tahun lalu
induk
melakukan
b088ed796b
1 mengubah file dengan 5 tambahan dan 2 penghapusan
  1. 5 2
      udpprojectset/src/cleareids.go

+ 5 - 2
udpprojectset/src/cleareids.go

@@ -35,10 +35,10 @@ func clearPKey() {
 	wg := sync.WaitGroup{}
 	for _, pncb := range []*KeyMap{PNKey, PCKey, PBKey} {
 		wg.Add(1)
-		go func() {
+		go func(pncb *KeyMap) {
 			defer wg.Done()
 			clearPNCBKey(pncb, nowtime)
-		}()
+		}(pncb)
 	}
 	wg.Wait()
 	log.Println("清理结束")
@@ -60,6 +60,9 @@ func clearIdsKeys(pKey *KeyMap, nowtime int64) []string {
 	for k, ma := range pKey.Map {
 		ids := ma.Arr
 		delids := []interface{}{}
+		if ids == nil {
+			continue
+		}
 		res := redis.Mget(REDISIDS, *ids)
 		for _, b1 := range res {
 			if b1 != nil {