From dcf17ff2048c99259e570857628a2a9980a56908 Mon Sep 17 00:00:00 2001 From: rabbitali Date: Tue, 24 Oct 2023 21:52:02 +0800 Subject: [PATCH] fix data correction task execution error --- ...data-correction-task-execution-error.patch | 41 +++++++++++++++++++ ...update-apollo-database-proxy-host.py.patch | 27 ++++++++++++ aops-apollo.spec | 8 +++- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 0007-fix-data-correction-task-execution-error.patch create mode 100644 0008-update-apollo-database-proxy-host.py.patch diff --git a/0007-fix-data-correction-task-execution-error.patch b/0007-fix-data-correction-task-execution-error.patch new file mode 100644 index 0000000..f3e532e --- /dev/null +++ b/0007-fix-data-correction-task-execution-error.patch @@ -0,0 +1,41 @@ +From fc2c7e76531306699e5c5dd0273dfe5fe521d2f8 Mon Sep 17 00:00:00 2001 +From: rabbitali +Date: Tue, 24 Oct 2023 20:39:44 +0800 +Subject: [PATCH 2/2] fix data correction task execution error + +--- + apollo/database/proxy/task.py | 2 +- + conf/apollo_crontab.yml | 5 ++--- + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/apollo/database/proxy/task.py b/apollo/database/proxy/task.py +index b1d53c4..17cb274 100644 +--- a/apollo/database/proxy/task.py ++++ b/apollo/database/proxy/task.py +@@ -3214,7 +3214,7 @@ class TaskProxy(TaskMysqlProxy, TaskEsProxy): + task_id_list = task_cve_id_list + task_repo_id_list + + task_query = self.session.query(Task).filter(Task.task_id.in_(task_id_list)).all() +- running_task_list = [(task.task_id, task.task_type, task.create_time) for task in task_query] ++ running_task_list = [(task.task_id, task.create_time) for task in task_query] + return running_task_list, host_info_list + + def update_host_status(self, host_id_list: list): +diff --git a/conf/apollo_crontab.yml b/conf/apollo_crontab.yml +index 29c17b4..4a1f1e9 100644 +--- a/conf/apollo_crontab.yml ++++ b/conf/apollo_crontab.yml +@@ -44,6 +44,5 @@ + type: data_correct + enable: true + timed: +- day_of_week: 0-6 +- hour: 3 +- trigger: cron +\ No newline at end of file ++ minutes: 20 ++ trigger: interval +\ No newline at end of file +-- +2.33.0 + diff --git a/0008-update-apollo-database-proxy-host.py.patch b/0008-update-apollo-database-proxy-host.py.patch new file mode 100644 index 0000000..0ec1d97 --- /dev/null +++ b/0008-update-apollo-database-proxy-host.py.patch @@ -0,0 +1,27 @@ +From a07a830d931dbcd60deb3c753414defe3e036a20 Mon Sep 17 00:00:00 2001 +From: xuyongliang_01 +Date: Mon, 23 Oct 2023 06:35:14 +0000 +Subject: [PATCH 1/2] update apollo/database/proxy/host.py. + +Signed-off-by: xuyongliang_01 +--- + apollo/database/proxy/host.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/apollo/database/proxy/host.py b/apollo/database/proxy/host.py +index 2ce2005..282193b 100644 +--- a/apollo/database/proxy/host.py ++++ b/apollo/database/proxy/host.py +@@ -15,9 +15,6 @@ Time: + Author: + Description: Host table operation + """ +-import math +-from collections import defaultdict +-from typing import List, Tuple + + from sqlalchemy import and_, case, func, or_ + from sqlalchemy.exc import SQLAlchemyError +-- +2.33.0 + diff --git a/aops-apollo.spec b/aops-apollo.spec index 9cfbfc3..47a4a76 100644 --- a/aops-apollo.spec +++ b/aops-apollo.spec @@ -1,6 +1,6 @@ Name: aops-apollo Version: v1.3.4 -Release: 7 +Release: 8 Summary: Cve management service, monitor machine vulnerabilities and provide fix functions. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} @@ -11,6 +11,9 @@ Patch0003: 0003-fix-cve-list-get-api-query-error.patch Patch0004: 0004-fix-query-cve-list-error-and-sql-error.patch Patch0005: 0005-fix-the-severity-field-filtering-error.patch Patch0006: 0006-fix-cve-list-by-host-count.patch +Patch0007: 0007-fix-data-correction-task-execution-error.patch +Patch0008: 0008-update-apollo-database-proxy-host.py.patch + BuildRequires: python3-setuptools Requires: aops-vulcanus >= v1.3.0 @@ -73,6 +76,9 @@ popd %{python3_sitelib}/aops_apollo_tool/* %changelog +* Tue Oct 24 2023 wenxin - v1.3.4-8 +- fix data correction task execution error + * Mon Oct 23 2023 gongzhengtang - v1.3.4-7 - fixed the problem that the number of hosts in the cve list repeated statistics