注释ad 属性添加代码
This commit is contained in:
parent
bfb502f1ab
commit
d26f29dba9
33
ad_tasks.py
33
ad_tasks.py
@ -95,21 +95,22 @@ def send_cache_data():
|
||||
item['y_offset'] = item['area'].split(',')[-1].strip().strip(')')
|
||||
except:
|
||||
item['y_offset'] = 0
|
||||
# try:
|
||||
# print(f"0={item}")
|
||||
# temp = {}
|
||||
# temp['jump_param'] = item.get('jump_param',"")
|
||||
# if not isinstance(item.get('ad_property', {}), dict):
|
||||
# if not item.get('ad_property', {}):
|
||||
# item['ad_property']={}.update(temp)
|
||||
# else:
|
||||
# item['ad_property'] = json.loads(item.get('ad_property', {}).replace("'",'"'))
|
||||
# item['ad_property'].update(temp)
|
||||
# print(f"item['ad_property']={item['ad_property']}")
|
||||
# #item['ad_property']=json.dumps(item['ad_property'])
|
||||
# print(f"1={item}")
|
||||
# except Exception:
|
||||
# log.error(f"write {item}",exc_info=True)
|
||||
try:
|
||||
print(f"0={item}")
|
||||
temp = {}
|
||||
temp['jump_param'] = item.get('jump_param', "")
|
||||
if not isinstance(item.get('ad_property', {}), dict):
|
||||
if not item.get('ad_property', {}):
|
||||
item['ad_property'] = {}.update(temp)
|
||||
else:
|
||||
pdb.set_trace()
|
||||
item['ad_property'] = json.loads(item.get('ad_property', {}).replace("'", '"'))
|
||||
item['ad_property'].update(temp)
|
||||
print(f"item['ad_property']={item['ad_property']}")
|
||||
#item['ad_property']=json.dumps(item['ad_property'])
|
||||
print(f"1={item}")
|
||||
except Exception:
|
||||
log.error(f"write {item}", exc_info=True)
|
||||
|
||||
all.append(item)
|
||||
except Exception:
|
||||
@ -144,7 +145,7 @@ def send_cache_data():
|
||||
remove_list = ('ad_num', 'gameid')
|
||||
for item in remove_list:
|
||||
line.pop(item)
|
||||
print(f"2={item}")
|
||||
print(f"2={line}")
|
||||
my_redis.hmset(f"ad::{line['id']}::info", line)
|
||||
my_redis.expire(f"ad::{line['id']}::info", 60)
|
||||
# my_redis.expire(f"ad::{line['id']}::info", 3600 * 24 * 7)
|
||||
|
Loading…
x
Reference in New Issue
Block a user