mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-30 16:43:28 +08:00
Fix: Handle DST in is_in_opsi_explore()
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
from module.base.timer import Timer
|
from module.base.timer import Timer
|
||||||
from module.base.utils import *
|
from module.base.utils import *
|
||||||
from module.config.utils import get_os_next_reset, DEFAULT_TIME
|
from module.config.utils import get_os_next_reset, DEFAULT_TIME
|
||||||
@@ -221,7 +223,12 @@ class MissionHandler(GlobeOperation, ZoneManager):
|
|||||||
next_reset = get_os_next_reset()
|
next_reset = get_os_next_reset()
|
||||||
logger.attr('OpsiNextReset', next_reset)
|
logger.attr('OpsiNextReset', next_reset)
|
||||||
logger.attr('OpsiExplore', (enable, next_run))
|
logger.attr('OpsiExplore', (enable, next_run))
|
||||||
if enable and next_run < next_reset:
|
# -12 hours to handle DST
|
||||||
|
# `next_run` might be calculated before DST but it's DST now
|
||||||
|
# 2023-03-14 11:15:28.423 | INFO | [OpsiNextReset] 2023-04-01 03:00:00
|
||||||
|
# 2023-03-14 11:15:28.425 | INFO | [OpsiExplore] (True, datetime.datetime(2023, 4, 1, 2, 0))
|
||||||
|
# 2023-03-14 11:15:28.426 | INFO | OpsiExplore is still running, accept missions only...
|
||||||
|
if enable and next_run < next_reset - timedelta(hours=12):
|
||||||
logger.info('OpsiExplore is still running, accept missions only. '
|
logger.info('OpsiExplore is still running, accept missions only. '
|
||||||
'Missions will be finished when OpsiExplore visits every zones, '
|
'Missions will be finished when OpsiExplore visits every zones, '
|
||||||
'no need to worry they are left behind.')
|
'no need to worry they are left behind.')
|
||||||
|
|||||||
Reference in New Issue
Block a user