Skip to content

Commit

Permalink
feat(backend): 节点日志查询时间调整 TencentBlueKing#8278
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Nov 29, 2024
1 parent 854269b commit af60ce0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbm-ui/backend/db_services/taskflow/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def get_version_logs(self, node_id: str, version_id: str) -> List[Dict[str, Dict
flow_node = FlowNode.objects.get(root_id=self.root_id, node_id=node_id)
except FlowNode.DoesNotExist:
return [self.generate_log_record(message=_("节点尚未运行,请稍后查看"))]
if flow_node.updated_at < timezone.now() - timedelta(days=7):
return [self.generate_log_record(message=_("节点日志仅保留7天"))]
if flow_node.updated_at < timezone.now() - timedelta(days=env.BKLOG_DEFAULT_RETENTION):
return [self.generate_log_record(message=_("节点日志仅保留{}天").format(env.BKLOG_DEFAULT_RETENTION))]

start_time = datetime2str(flow_node.started_at)
end_time = datetime2str(flow_node.updated_at + timedelta(days=7))
Expand Down

0 comments on commit af60ce0

Please sign in to comment.