From fb0ef6cf7bcc1d7bbbf09d6d79c214374c952e27 Mon Sep 17 00:00:00 2001 From: pengtao Date: Wed, 17 Jul 2019 17:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=9D=A1=E6=95=B0=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ad_interface_tornado.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ad_interface_tornado.py b/ad_interface_tornado.py index c8f99ad..952ce88 100644 --- a/ad_interface_tornado.py +++ b/ad_interface_tornado.py @@ -61,11 +61,11 @@ def send_cache_data(): # log.info(f"get data was {all}!\n") for line in all: key = f"ad::{line.get('gameid', 0)}::{line.get('locationid', 0)}" - if line['ad_num'] > 0: + if int(line['ad_num']) > 0: num = my_redis.get(f"ad::{line['id']}::num") if not num: num = 0 - if line['ad_num'] > num: + if int(line['ad_num']) > int(num): my_redis.sadd(key, line['id']) my_redis.expire(key, 120) n = int(line['ad_num'] - num) @@ -73,7 +73,7 @@ def send_cache_data(): else: my_redis.srem(key, line['id']) log.info(f"remove {line['id']} from {key}!") - elif line['ad_num'] == 0: + elif int(line['ad_num']) == 0: my_redis.sadd(key, line['id']) my_redis.expire(key, 120) log.info(f"add {line['id']} to {key} ,num was unlimit !")