Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: project timestamp update use async singlton task. #1468

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dongtai_engine/signals/handlers/vul_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def save_vul(vul_meta, vul_level, strategy_id, vul_stack, top_stack,
param_name=param_name,
).order_by('-latest_time').first()
project_time_stamp_update.apply_async(
(method_pool.agent.bind_project_id, ), countdown=5)
(vul_meta.agent.bind_project_id, ), countdown=5)
if vul:
vul.url = vul_meta.url
vul.uri = vul_meta.uri
Expand Down Expand Up @@ -444,7 +444,7 @@ def handler_replay_vul(vul_meta, vul_level, strategy_id, vul_stack, top_stack,
vul.save(
update_fields=['status_id', 'latest_time', 'latest_time_desc'])
project_time_stamp_update.apply_async(
(method_pool.agent.bind_project_id, ), countdown=5)
(vul_meta.agent.bind_project_id, ), countdown=5)

IastReplayQueue.objects.filter(id=kwargs['replay_id']).update(
state=const.SOLVED,
Expand Down
2 changes: 1 addition & 1 deletion dongtai_engine/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from dongtai_engine.task_base import replay_payload_data
from typing import List, Dict
from dongtai_engine.common.queryset import get_scan_id, load_sink_strategy, get_agent
from dongtai_engine.plugins.project_time_update import project_time_update
from dongtai_engine.plugins.project_time_update import project_time_stamp_update

RETRY_INTERVALS = [10, 30, 90]

Expand Down
2 changes: 1 addition & 1 deletion dongtai_protocol/report/handler/api_route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def save(self):
print(e)
logger.info(_('API navigation log record successfully'))
project_time_stamp_update.apply_async(
(method_pool.agent.bind_project_id, ), countdown=5)
(self.agent.bind_project_id, ), countdown=5)
except Exception as e:
logger.info(_('API navigation log failed, why: {}').format(e))

Expand Down