优化停留间隔,循环获取乘客问题
This commit is contained in:
@@ -141,8 +141,10 @@ class Order:
|
||||
return True
|
||||
else:
|
||||
if (str(result.get('messages', '')).find('未处理') >= 0): # 未处理订单
|
||||
self.order_id = 0 # 需要拿到订单号 TODO
|
||||
return -1
|
||||
# 0125 增加排队时长到 5 分钟之后,更多的是 排队失败,得通过拿到订单列表才能确认,再打个 TODO
|
||||
# self.order_id = 0 # 需要拿到订单号 TODO
|
||||
# return -1
|
||||
pass
|
||||
OrderLog.add_quick_log(
|
||||
OrderLog.MESSAGE_SUBMIT_ORDER_REQUEST_FAIL.format(
|
||||
result.get('messages', CommonLog.MESSAGE_RESPONSE_EMPTY_ERROR))).flush()
|
||||
|
||||
@@ -45,6 +45,7 @@ class Job:
|
||||
|
||||
interval = {}
|
||||
interval_additional = 0
|
||||
interval_additional_max = 5
|
||||
|
||||
query = None
|
||||
cluster = None
|
||||
@@ -224,10 +225,8 @@ class Job:
|
||||
"""
|
||||
if response.status_code != 200:
|
||||
QueryLog.print_query_error(response.reason, response.status_code)
|
||||
if self.interval_additional:
|
||||
self.interval_additional += self.interval_additional
|
||||
else:
|
||||
self.interval_additional = self.interval.get('min')
|
||||
if self.interval_additional < self.interval_additional_max:
|
||||
self.interval_additional += self.interval.get('min')
|
||||
else:
|
||||
self.interval_additional = 0
|
||||
result = response.json().get('data.result')
|
||||
|
||||
@@ -311,6 +311,8 @@ class UserJob:
|
||||
UserLog.add_quick_log(
|
||||
UserLog.MESSAGE_GET_USER_PASSENGERS_FAIL.format(
|
||||
result.get('messages', CommonLog.MESSAGE_RESPONSE_EMPTY_ERROR), self.retry_time)).flush()
|
||||
if Config().is_slave():
|
||||
self.load_user_from_remote() # 加载最新 cookie
|
||||
stay_second(self.retry_time)
|
||||
return self.get_user_passengers()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user