From fd2d5f06b087965ee588f8e74853cd2032130efa Mon Sep 17 00:00:00 2001 From: Gennady Kovshenin Date: Thu, 6 Oct 2022 06:21:04 +0300 Subject: 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. --- templates/swagger/v1_json.tmpl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'templates/swagger') 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 @@ -3264,6 +3264,12 @@ "name": "path", "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)", -- cgit v1.2.3