info key刷新时间调整

This commit is contained in:
pengtao 2019-09-17 17:11:41 +08:00
parent b86951650b
commit f869935aba

View File

@ -11,7 +11,7 @@ import datetime
import pdb import pdb
import json import json
import copy import copy
import time
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
parser = reqparse.RequestParser() parser = reqparse.RequestParser()
@ -39,6 +39,8 @@ class RelushADinfo(Resource):
if need_change_keys: if need_change_keys:
for one in need_change_keys: for one in need_change_keys:
key = f"adinfo::{one}::info" key = f"adinfo::{one}::info"
my_redis.expire(key, 1)
time.sleep(1)
adid = one.split('_')[0] adid = one.split('_')[0]
locationid = one.split('_')[1] locationid = one.split('_')[1]
areas = self._get_areas(locationid) areas = self._get_areas(locationid)
@ -67,7 +69,6 @@ class RelushADinfo(Resource):
return None return None
def _get_adinfo(self, id): def _get_adinfo(self, id):
all = []
sql = f"""select sql = f"""select
id, id,
name, name,
@ -93,7 +94,6 @@ class RelushADinfo(Resource):
data = self.mydb.query(sql) data = self.mydb.query(sql)
pdb.set_trace()
if data: if data:
try: try:
line = data[0] line = data[0]