update timed task arg check

This commit is contained in:
rabbitali 2023-10-25 19:40:17 +08:00
parent bdd8a0f31b
commit b4f088a338
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 8da5f67a67240f1bcc3f3f9d8cd8e6d5b20eb303 Mon Sep 17 00:00:00 2001
From: rabbitali <wenxin32@foxmail.com>
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

View File

@ -1,6 +1,6 @@
Name: aops-vulcanus
Version: v1.3.0
Release: 6
Release: 7
Summary: A basic tool libraries of aops, including logging, configure and response, etc.
License: MulanPSL2
URL: https://gitee.com/openeuler/%{name}
@ -12,6 +12,7 @@ Patch0004: 0004-fix-information-path-incorrect.patch
Patch0005: 0005-suitable-for-version-2003-sp3.patch
Patch0006: 0006-fix-python3-prometheus-api-client-import-error.patch
Patch0007: 0007-update-timed-task-args-check-and-timeout.patch
Patch0008: 0008-update-timed-task-args-check.patch
BuildRequires: python3-setuptools
@ -67,6 +68,9 @@ cp -r scripts %{buildroot}/opt/aops/
%changelog
* Wed Oct 25 2023 wenxin<wenxin32@foxmail.com> - v1.3.0-7
- update timed task args check
* Wed Oct 25 2023 wenxin<wenxin32@foxmail.com> - v1.3.0-6
- since there is no arm-arch package in new repo source, remove changes of the es repo source url