|
|
@@ -26,9 +26,6 @@ from module.exception import RequestHumanTakeover, ScriptError
|
|
|
from module.logger import logger
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
class Function:
|
|
|
def __init__(self, key: str, data: dict):
|
|
|
"""
|
|
|
@@ -258,8 +255,7 @@ class Config(ConfigState, ConfigManual, ConfigWatcher, ConfigMenu):
|
|
|
data = {"running": running, "pending": pending, "waiting": waiting}
|
|
|
return data
|
|
|
|
|
|
-
|
|
|
- def task_call(self, task: str=None, force_call=True):
|
|
|
+ def task_call(self, task: str = None, force_call=True):
|
|
|
"""
|
|
|
回调任务,这会是在任务结束后调用
|
|
|
:param task: 调用的任务的大写名称
|
|
|
@@ -284,7 +280,7 @@ class Config(ConfigState, ConfigManual, ConfigWatcher, ConfigMenu):
|
|
|
return False
|
|
|
|
|
|
def task_delay(self, task: str, start_time: datetime = None,
|
|
|
- success: bool=None, server: bool=True, target: datetime=None) -> None:
|
|
|
+ success: bool = None, server: bool = True, target: datetime = None) -> None:
|
|
|
"""
|
|
|
设置下次运行时间 当然这个也是可以重写的
|
|
|
:param target: 可以自定义的下次运行时间
|
|
|
@@ -348,7 +344,7 @@ class Config(ConfigState, ConfigManual, ConfigWatcher, ConfigMenu):
|
|
|
run = min(run).replace(microsecond=0)
|
|
|
next_run = run
|
|
|
|
|
|
- if server and hasattr(scheduler, 'server_update'):
|
|
|
+ if server and hasattr(scheduler, 'server_update') and target is None:
|
|
|
# 加入随机延迟时间
|
|
|
float_seconds = (scheduler.float_time.hour * 3600 +
|
|
|
scheduler.float_time.minute * 60 +
|
|
|
@@ -385,14 +381,8 @@ class Config(ConfigState, ConfigManual, ConfigWatcher, ConfigMenu):
|
|
|
logger.attr(f'{task}.scheduler.next_run', next_run)
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
if __name__ == '__main__':
|
|
|
config = Config(config_name='oas1')
|
|
|
config.notifier.push(title="0000", content="dddddddd")
|
|
|
|
|
|
# print(config.get_next())
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|