fix key not found in redis
This commit is contained in:
parent
2e821a68a2
commit
5707dbd297
@ -111,16 +111,20 @@ class DispatchHandler(tornado.web.RequestHandler):
|
|||||||
key_word = f"ad::{gameid}_*::{channelid}::{area}::*"
|
key_word = f"ad::{gameid}_*::{channelid}::{area}::*"
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
ad_keys = my_redis.keys(key_word)
|
try:
|
||||||
|
ad_keys = my_redis.keys(key_word)
|
||||||
|
except Exception:
|
||||||
|
log.error(f"{ad_keys} not found in redis!")
|
||||||
ids = []
|
ids = []
|
||||||
for ad_key in ad_keys:
|
if ad_keys:
|
||||||
adlists = my_redis.smembers(ad_key)
|
for ad_key in ad_keys:
|
||||||
try:
|
adlists = my_redis.smembers(ad_key)
|
||||||
for key in adlists:
|
try:
|
||||||
ids.append(key)
|
for key in adlists:
|
||||||
except Exception:
|
ids.append(key)
|
||||||
log.error(f"get redis data failed!", exc_info=True)
|
except Exception:
|
||||||
return self.write({'errcode': 2, "errmsg": f"get redis data failed!"})
|
log.error(f"get redis data failed!", exc_info=True)
|
||||||
|
return self.write({'errcode': 2, "errmsg": f"get redis data failed!"})
|
||||||
dist_ids = list(set(ids))
|
dist_ids = list(set(ids))
|
||||||
info = []
|
info = []
|
||||||
if not dist_ids:
|
if not dist_ids:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user