修复autoSynchroTime文件未提交问题

This commit is contained in:
wenxianping
2019-01-03 09:25:54 +08:00
parent 4d07e5369a
commit af5ece8c3e
2 changed files with 62 additions and 12 deletions

View File

@@ -183,23 +183,20 @@ class select:
try:
num += 1
check_user.sendCheckUser()
if time.strftime('%H:%M:%S', time.localtime(time.time())) > "23:00:00" or time.strftime('%H:%M:%S',
time.localtime(
time.time())) < "06:00:00":
print(ticket.REST_TIME)
while 1:
time.sleep(1)
if "06:00:00" < time.strftime('%H:%M:%S', time.localtime(time.time())) < "23:00:00":
print(ticket.REST_TIME_PAST)
self.call_login()
break
start_time = datetime.datetime.now()
now = datetime.datetime.now()
if now.hour >= 23 or now.hour < 6:
print(u"12306休息时间本程序自动停止,明天早上七点将自动运行")
open_time = datetime.datetime(now.year, now.month, now.day, 6)
if open_time < now:
open_time += datetime.timedelta(1)
time.sleep((open_time - now).seconds)
self.call_login()
if self.order_model is 1:
autoSynchroTime()
sleep_time_s = 0.1
sleep_time_t = 0.5
# 测试了一下有微妙级的误差应该不影响测试结果2019-01-02 22:30:00.004555
if start_time.strftime("%M:%S") == "29:55" or start_time.strftime("%M:%S") == "59:55":
if now.strftime("%M:%S") == "29:55" or now.strftime("%M:%S") == "59:55":
print(u"预售整点模式卡点中")
time.sleep(5)
print(u"预售模式执行")