mirror of https://github.com/testerSunshine/12306
改为7点运行
parent
e2c645f7f7
commit
35ec27b7d7
|
@ -117,9 +117,9 @@ def getCacheFile(cacheType):
|
|||
|
||||
def checkSleepTime(session):
|
||||
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 now.hour >= 23 or now.hour < 7:
|
||||
print(u"12306休息时间,本程序自动停止,明天早上六点将自动运行")
|
||||
open_time = datetime.datetime(now.year, now.month, now.day, 7)
|
||||
if open_time < now:
|
||||
open_time += datetime.timedelta(1)
|
||||
time.sleep((open_time - now).seconds + round(random.uniform(1, 10)))
|
||||
|
|
Loading…
Reference in New Issue