aboutsummaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2020-02-15 07:51:25 -0300
committerGitHub <noreply@github.com>2020-02-15 11:51:25 +0100
commit15614a83682f972bbe900cae935fdc47c4e80e2e (patch)
treef62deab22b6c98417920faf914d1cb7f92c0e87f /models/models.go
parent7e920703f94c4f2782860a72cc6beca5671736f5 (diff)
downloadgitea-15614a83682f972bbe900cae935fdc47c4e80e2e.tar.gz
gitea-15614a83682f972bbe900cae935fdc47c4e80e2e.zip
Divide GetIssueStats query in smaller chunks (#10176)
* Divide GetIssueStats query in smaller chunks * Skip chunking if count is low enough * Fix lint * Define maxQueryParameters * Remove absMaxQueryParameters because of lint * Restart CI * Restart CI Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go
index b84a179e37..088445590f 100644
--- a/models/models.go
+++ b/models/models.go
@@ -48,6 +48,12 @@ type Engine interface {
SumInt(bean interface{}, columnName string) (res int64, err error)
}
+const (
+ // When queries are broken down in parts because of the number
+ // of parameters, attempt to break by this amount
+ maxQueryParameters = 300
+)
+
var (
x *xorm.Engine
tables []interface{}