Skip to content

Commit

Permalink
WaitAvailableAction countdown calibration
Browse files Browse the repository at this point in the history
  • Loading branch information
J1uShan9 committed Jun 29, 2024
1 parent 278469b commit eaa45e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/Task/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,23 @@ def WaitAvailableAction(self) -> None:
"""
等待开票
"""
interval = abs(self.api.GetSaleStartTime() - int(time()))
countdown = interval
countdown = abs(self.api.GetSaleStartTime() - int(time()))

if countdown >= 3600:
for _ in range(countdown//10):
countdown = abs(self.api.GetSaleStartTime() - int(time()))
logger.info(f"【等待开票】需要等待 {countdown/60:.1f} 分钟")
sleep(600)
countdown -= 600
if 3600 > countdown >= 600:
for _ in range(10):
countdown = abs(self.api.GetSaleStartTime() - int(time()))
logger.info(f"【等待开票】即将开票! 需要等待 {countdown/60:.1f} 分钟")
sleep(60)
countdown -=60
if 600 > countdown >= 60:
for _ in range(12):
countdown = abs(self.api.GetSaleStartTime() - int(time()))
logger.info(f"【等待开票】准备开票! 需要等待 {countdown/60:.1f} 分钟")
sleep(5)
countdown -=5
Expand Down

0 comments on commit eaa45e9

Please sign in to comment.