|
@@ -161,13 +161,6 @@ class Response(object):
|
|
|
L = []
|
|
|
new_item_list = []
|
|
|
for index, item in enumerate(response, 1):
|
|
|
- # random_num = random.randint(1, 10)
|
|
|
- # if random_num in [1, 2, 3, 4, 5, 6]:
|
|
|
- # long_articles_mini_program_id = 25
|
|
|
- # elif random_num in [7, 8]:
|
|
|
- # long_articles_mini_program_id = 29
|
|
|
- # else:
|
|
|
- # long_articles_mini_program_id = 31
|
|
|
card, new_item = await self.generate_single_card(index, gh_id, long_articles_mini_program_id, item)
|
|
|
L.append(card)
|
|
|
new_item_list.append(new_item)
|
|
@@ -199,7 +192,7 @@ class Response(object):
|
|
|
process_times = response.get('process_times')
|
|
|
match status_code:
|
|
|
case 0:
|
|
|
- if process_times > self.TASK_MAX_PROCESS_TIMES:
|
|
|
+ if process_times > server_const.TASK_MAX_PROCESS_TIMES:
|
|
|
result = {
|
|
|
"traceId": self.trace_id,
|
|
|
"code": 0,
|
|
@@ -240,8 +233,8 @@ class Response(object):
|
|
|
affected_rows = await self.mysql_client.async_insert(
|
|
|
sql=update_sql,
|
|
|
params=(
|
|
|
- self.REQUEST_PROCESSING_TASK,
|
|
|
- self.REQUEST_INIT_STATUS,
|
|
|
+ server_const.REQUEST_PROCESSING_TASK,
|
|
|
+ server_const.REQUEST_INIT_STATUS,
|
|
|
self.trace_id
|
|
|
)
|
|
|
)
|
|
@@ -261,9 +254,9 @@ class Response(object):
|
|
|
sql=update_sql,
|
|
|
params=(
|
|
|
json.dumps(new_items, ensure_ascii=False),
|
|
|
- self.REQUEST_SUCCESS_STATUS,
|
|
|
+ server_const.REQUEST_SUCCESS_STATUS,
|
|
|
self.trace_id,
|
|
|
- self.REQUEST_PROCESSING_TASK
|
|
|
+ server_const.REQUEST_PROCESSING_TASK
|
|
|
)
|
|
|
)
|
|
|
return {
|