Skip to content

Commit

Permalink
feat: 当计算到错误票价时候自动更新 #423
Browse files Browse the repository at this point in the history
  • Loading branch information
mikumifa committed Sep 15, 2024
1 parent c001024 commit 08b063f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tab/go.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ def run_validation():

@retry.retry(exceptions=RequestException, tries=60, delay=interval / 1000)
def inner_request():
nonlocal payload
if not isRunning:
raise ValueError("抢票结束")
ret = _request.post(
Expand All @@ -573,6 +574,12 @@ def inner_request():
logger.info(
f'状态码: {err}({ERRNO_DICT.get(err, "未知错误码")}), 请求体: {ret}'
)
if err == 100034:
logger.info(
f'更新票价为:{ret["data"]["pay_money"] / 100}'
)
tickets_info["pay_money"] = ret["data"]["pay_money"]
payload = format_dictionary_to_string(tickets_info)
if err == 0 or err == 100048 or err == 100079:
return ret, err
if err == 100051:
Expand Down
3 changes: 2 additions & 1 deletion util/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
100039: "活动收摊啦,下次要快点哦",
100048: "已经下单,有尚未完成订单",
100017: "票种不可售",
100051: "订单准备过期,重新验证"
100051: "订单准备过期,重新验证",
100034: "票价错误"
}


Expand Down

0 comments on commit 08b063f

Please sign in to comment.