From 8da5f67a67240f1bcc3f3f9d8cd8e6d5b20eb303 Mon Sep 17 00:00:00 2001 From: rabbitali Date: Wed, 25 Oct 2023 19:06:52 +0800 Subject: [PATCH] update timed task args check --- vulcanus/timed.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vulcanus/timed.py b/vulcanus/timed.py index 7d31bee..9657da0 100644 --- a/vulcanus/timed.py +++ b/vulcanus/timed.py @@ -94,11 +94,11 @@ class TimedTask: LOGGER.error("Wrong trigger parameter for timed tasks : %s.", trigger) return False - if "day_of_week" not in timed or "hour" not in timed or "minutes" not in timed: - LOGGER.error("Missing required fields when creating scheduled task.") - return False + if ("day_of_week" in timed and "hour" in timed) or ("minutes" in timed): + return True - return True + LOGGER.error("Missing required fields when creating scheduled task.") + return False class TimedTaskManager: -- 2.33.0