-
Notifications
You must be signed in to change notification settings - Fork 377
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
perf: 任务列表响应速度优化 #7489 #7498
perf: 任务列表响应速度优化 #7489 #7498
Conversation
@@ -307,6 +311,13 @@ def list(self, request, *args, **kwargs): | |||
) | |||
|
|||
page = list(queryset) | |||
elif "no_pagination" in request.query_params: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no_pagination -> with_count
gcloud/apigw/views/utils.py
Outdated
@@ -180,7 +180,10 @@ def paginate_list_data(request, queryset): | |||
limit = int(request.GET.get("limit", 100)) | |||
# limit 最大数量为200 | |||
limit = 200 if limit > 200 else limit | |||
count = queryset.count() | |||
if request.GET.get("no_pagination"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without_count
gcloud/apigw/views/utils.py
Outdated
@@ -180,7 +180,10 @@ def paginate_list_data(request, queryset): | |||
limit = int(request.GET.get("limit", 100)) | |||
# limit 最大数量为200 | |||
limit = 200 if limit > 200 else limit | |||
count = queryset.count() | |||
if request.GET.get("no_pagination"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_task_list apigw api 文档说明
docs/apidoc/zh_hans/get_task_list.md
Outdated
@@ -15,6 +15,7 @@ | |||
| expected_timezone | string | 否 | 任务时间相关字段期望返回的时区,形如Asia/Shanghai | | |||
| limit | int | 否 | 分页,返回任务列表任务数,默认为100 | | |||
| offset | int | 否 | 分页,返回任务列表起始任务下标,默认为0 | | |||
| without_count | bool | 否 | 有无count,默认有 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without_count=false 会有问题,【默认有】改成【默认返回 count 信息】
gcloud/apigw/views/utils.py
Outdated
@@ -180,7 +180,10 @@ def paginate_list_data(request, queryset): | |||
limit = int(request.GET.get("limit", 100)) | |||
# limit 最大数量为200 | |||
limit = 200 if limit > 200 else limit | |||
count = queryset.count() | |||
if request.GET.get("without_count"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议添加一个参数,without_count=False
No description provided.