mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 13:39:25 +08:00
add: clear task when no task
This commit is contained in:
2
alas.py
2
alas.py
@@ -8,6 +8,7 @@ from datetime import datetime, timedelta
|
|||||||
import inflection
|
import inflection
|
||||||
from cached_property import cached_property
|
from cached_property import cached_property
|
||||||
|
|
||||||
|
import scheduler_watcher
|
||||||
from module.base.decorator import del_cached_property
|
from module.base.decorator import del_cached_property
|
||||||
from module.config.config import AzurLaneConfig, TaskEnd
|
from module.config.config import AzurLaneConfig, TaskEnd
|
||||||
from module.config.deep import deep_get, deep_set
|
from module.config.deep import deep_get, deep_set
|
||||||
@@ -718,6 +719,7 @@ class AzurLaneAutoScript:
|
|||||||
release_resources(next_task=task.command)
|
release_resources(next_task=task.command)
|
||||||
|
|
||||||
if task.next_run > datetime.now():
|
if task.next_run > datetime.now():
|
||||||
|
scheduler_watcher.no_task()
|
||||||
logger.info(f'Wait until {task.next_run} for task `{task.command}`')
|
logger.info(f'Wait until {task.next_run} for task `{task.command}`')
|
||||||
self.is_first_task = False
|
self.is_first_task = False
|
||||||
method = self.config.Optimization_WhenTaskQueueEmpty
|
method = self.config.Optimization_WhenTaskQueueEmpty
|
||||||
|
|||||||
@@ -107,3 +107,8 @@ class SchedulerWatcher:
|
|||||||
def request_extend_task_deadline():
|
def request_extend_task_deadline():
|
||||||
ins = SchedulerWatcher.get_instance()
|
ins = SchedulerWatcher.get_instance()
|
||||||
ins.request_extend_task_deadline()
|
ins.request_extend_task_deadline()
|
||||||
|
|
||||||
|
|
||||||
|
def no_task():
|
||||||
|
ins = SchedulerWatcher.get_instance()
|
||||||
|
ins.no_task()
|
||||||
|
|||||||
Reference in New Issue
Block a user