fix some error

This commit is contained in:
pengtao 2019-07-15 16:21:07 +08:00
parent 1520889b20
commit 43ecffc2d9

View File

@ -60,7 +60,10 @@ def send_cache_data():
key = f"{line.get('gameid', 0)}::{line.get('locationid', 0)}"
if my_redis.exists(key):
# 检查num是否已达到设定数值
num = my_redis.get(f"{key}:num") or 0
num = my_redis.get(f"{key}:num")
if not num:
num=0
print("num was ",num)
if line['num'] != -1 and line['num'] <= num:
# 该广告已播放达到次数,从缓存中清除
my_redis.srem(key, line['id'])