mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-22 00:35:34 +00:00
Opt: Align assignment to server update
so save time on cloud
This commit is contained in:
parent
048abcfde4
commit
68842a187c
@ -74,6 +74,11 @@ class Assignment(AssignmentClaim, SynthesizeUI):
|
|||||||
delay = min(self.dispatched.values())
|
delay = min(self.dispatched.values())
|
||||||
logger.info(f'Delay assignment check to {str(delay)}')
|
logger.info(f'Delay assignment check to {str(delay)}')
|
||||||
self.config.task_delay(target=delay)
|
self.config.task_delay(target=delay)
|
||||||
|
# Align server update
|
||||||
|
update = get_server_next_update(self.config.Scheduler_ServerUpdate)
|
||||||
|
if update - delay < timedelta(hours=4):
|
||||||
|
logger.info('Approaching next day, delay to server update instead')
|
||||||
|
self.config.task_delay(target=update)
|
||||||
else:
|
else:
|
||||||
# ValueError: min() arg is an empty sequence
|
# ValueError: min() arg is an empty sequence
|
||||||
logger.error('Empty dispatched list, delay 2 hours instead')
|
logger.error('Empty dispatched list, delay 2 hours instead')
|
||||||
|
Loading…
Reference in New Issue
Block a user