Skip to content

Commit

Permalink
bugfix: 修复我的动态接口加载速度过慢的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuaikang committed Sep 11, 2023
1 parent 9dbfce7 commit ac33658
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gcloud/core/apis/drf/viewsets/taskflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,8 @@ def _optimized_my_dynamic_query(queryset, username, limit, offset, create_method
original_query,
)
new_query = re.sub("ORDER BY (.*?) DESC", "ORDER BY `pipeline_pipelineinstance`.`id` DESC", new_query)
new_query = new_query.replace(username, f"'{username}'")
if create_method:
new_query = new_query.replace(create_method, f"'{create_method}'")
new_query += f" LIMIT {limit} OFFSET {offset}"
return TaskFlowInstance.objects.raw(original_query, params)
return TaskFlowInstance.objects.raw(new_query, params)

@swagger_auto_schema(
method="GET",
Expand Down

0 comments on commit ac33658

Please sign in to comment.