!111 fix data correction task execution error

From: @rabbitali 
Reviewed-by: @zhu-yuncheng 
Signed-off-by: @zhu-yuncheng
This commit is contained in:
openeuler-ci-bot 2023-10-24 14:21:07 +00:00 committed by Gitee
commit c23d2dc96d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 75 additions and 1 deletions

View File

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

View File

@ -0,0 +1,27 @@
From a07a830d931dbcd60deb3c753414defe3e036a20 Mon Sep 17 00:00:00 2001
From: xuyongliang_01 <xuyongliang_yewu@cmss.chinamobile.com>
Date: Mon, 23 Oct 2023 06:35:14 +0000
Subject: [PATCH 1/2] update apollo/database/proxy/host.py.
Signed-off-by: xuyongliang_01 <xuyongliang_yewu@cmss.chinamobile.com>
---
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

View File

@ -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<wenxin32@foxmail.com> - v1.3.4-8
- fix data correction task execution error
* Mon Oct 23 2023 gongzhengtang<gong_zhengtang@163.com> - v1.3.4-7
- fixed the problem that the number of hosts in the cve list repeated statistics