aboutsummaryrefslogtreecommitdiffstats
path: root/templates/swagger
diff options
context:
space:
mode:
authorGennady Kovshenin <gennady@kovshenin.com>2022-10-06 06:21:04 +0300
committerGitHub <noreply@github.com>2022-10-06 11:21:04 +0800
commitfd2d5f06b087965ee588f8e74853cd2032130efa (patch)
tree7dba7c7eeedf14e4f0212c2c9fa6315249a5c7b6 /templates/swagger
parent8765f139c7a1f3b5aafb83ae9b095e6066d77a50 (diff)
downloadgitea-fd2d5f06b087965ee588f8e74853cd2032130efa.tar.gz
gitea-fd2d5f06b087965ee588f8e74853cd2032130efa.zip
Add `stat` to `ToCommit` function for speed (#21337)
Calls to ToCommit are very slow due to fetching diffs, analyzing files. This patch lets us supply `stat` as false to speed fetching a commit when we don't need the diff. /v1/repo/commits has a default `stat` set as true now. Set to false to experience fetching thousands of commits per second instead of 2-5 per second.
Diffstat (limited to 'templates/swagger')
-rw-r--r--templates/swagger/v1_json.tmpl6
1 files changed, 6 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 00d769cdd1..5ca3794710 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -3265,6 +3265,12 @@
"in": "query"
},
{
+ "type": "boolean",
+ "description": "include diff stats for every commit (disable for speedup, default 'true')",
+ "name": "stat",
+ "in": "query"
+ },
+ {
"type": "integer",
"description": "page number of results to return (1-based)",
"name": "page",