mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-20 14:59:12 +00:00
temp fix to increase size on non SQLite db
This commit is contained in:
@@ -40,6 +40,14 @@ func rebind(query string) string {
|
|||||||
// to a sql IN statment.
|
// to a sql IN statment.
|
||||||
func toList(listof []*model.RepoLite) (string, []interface{}) {
|
func toList(listof []*model.RepoLite) (string, []interface{}) {
|
||||||
var size = len(listof)
|
var size = len(listof)
|
||||||
|
switch {
|
||||||
|
case meddler.Default == meddler.SQLite && size > 999:
|
||||||
|
size = 999
|
||||||
|
listof = listof[:999]
|
||||||
|
case size > 15000:
|
||||||
|
size = 15000
|
||||||
|
listof = listof[:15000]
|
||||||
|
}
|
||||||
var qs = make([]string, size, size)
|
var qs = make([]string, size, size)
|
||||||
var in = make([]interface{}, size, size)
|
var in = make([]interface{}, size, size)
|
||||||
for i, repo := range listof {
|
for i, repo := range listof {
|
||||||
@@ -53,6 +61,14 @@ func toList(listof []*model.RepoLite) (string, []interface{}) {
|
|||||||
// to a sql IN statement compatible with postgres.
|
// to a sql IN statement compatible with postgres.
|
||||||
func toListPostgres(listof []*model.RepoLite) (string, []interface{}) {
|
func toListPostgres(listof []*model.RepoLite) (string, []interface{}) {
|
||||||
var size = len(listof)
|
var size = len(listof)
|
||||||
|
switch {
|
||||||
|
case meddler.Default == meddler.SQLite && size > 999:
|
||||||
|
size = 999
|
||||||
|
listof = listof[:999]
|
||||||
|
case size > 15000:
|
||||||
|
size = 15000
|
||||||
|
listof = listof[:15000]
|
||||||
|
}
|
||||||
var qs = make([]string, size, size)
|
var qs = make([]string, size, size)
|
||||||
var in = make([]interface{}, size, size)
|
var in = make([]interface{}, size, size)
|
||||||
for i, repo := range listof {
|
for i, repo := range listof {
|
||||||
|
Reference in New Issue
Block a user