广告位置修改参数判断,拆分

This commit is contained in:
pengtao 2019-09-19 17:17:35 +08:00
parent 4e6034565a
commit 85a92dea6e

View File

@ -30,7 +30,7 @@ class RelushADinfo(Resource):
locationid = self.args['locationid']
if locationid:
need_change_keys = set()
key_word = f"ad::*_{locationid}*::*::{locationid}"
key_word = f"ad::*_{locationid}_*::*::{locationid}"
adlists = my_redis.keys(key_word)
if adlists:
for key in adlists:
@ -39,6 +39,7 @@ class RelushADinfo(Resource):
if need_change_keys:
for one in need_change_keys:
key = f"adinfo::{one}::info"
log.info(f"reflush key={key} set expire!")
my_redis.expire(key, 1)
time.sleep(1)
adid = one.split('_')[0]
@ -53,6 +54,7 @@ class RelushADinfo(Resource):
for item in self.remove_list:
full_info.pop(item)
my_redis.hmset(key, full_info)
log.info(f"reflush key ={key} with {full_info}")
my_redis.expire(key, self.expired)
return jsonify({'code': 200, 'message': f"reflush key locationid={locationid}!"})
else: