Skip to content

Commit

Permalink
feat: 添加返回数据间隔时间 --story=120737215
Browse files Browse the repository at this point in the history
  • Loading branch information
guohelu committed Nov 28, 2024
1 parent b6844f6 commit dcbb139
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gcloud/core/apis/drf/viewsets/periodic_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from rest_framework.response import Response

from gcloud import err_code
from gcloud.conf import settings
from gcloud.common_template.models import CommonTemplate
from gcloud.constants import COMMON, PERIOD_TASK_NAME_MAX_LENGTH, PROJECT
from gcloud.contrib.audit.utils import bk_audit_add_event
Expand Down Expand Up @@ -228,7 +229,9 @@ def list(self, request, *args, **kwargs):
inst["auth_actions"].append(view_action)
inst["is_collected"] = 1 if inst["id"] in collection_task_ids else 0
inst["collection_id"] = collection_task_map.get(inst["id"], -1)
return self.get_paginated_response(instances) if page is not None else Response(instances)
result = self.get_paginated_response(instances) if page is not None else Response(instances)
result.data["interval_time"] = settings.PERIODIC_TASK_SHORTEST_TIME
return result

def retrieve(self, request, *args, **kwargs):
instance = self.get_object()
Expand Down

0 comments on commit dcbb139

Please sign in to comment.