aboutsummaryrefslogtreecommitdiffstats
path: root/models/db
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-09-23 18:50:06 +0800
committerGitHub <noreply@github.com>2021-09-23 18:50:06 +0800
commitd9c69596fff1a1482cbc15ac220f9d5e1829a5ea (patch)
tree1e39fa59ad38cdd9a0a9c3a1f3e4bc331bed405e /models/db
parentd9e237e3f268d786af028ba8e7cc24f70a6d6a36 (diff)
downloadgitea-d9c69596fff1a1482cbc15ac220f9d5e1829a5ea.tar.gz
gitea-d9c69596fff1a1482cbc15ac220f9d5e1829a5ea.zip
Fix commit status index problem (#17061)
* Fix commit status index problem * remove unused functions * Add fixture and test for migration * Fix lint * Fix fixture * Fix lint * Fix test * Fix bug * Fix bug
Diffstat (limited to 'models/db')
-rw-r--r--models/db/index.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/db/index.go b/models/db/index.go
index 873289db54..0086a8f548 100644
--- a/models/db/index.go
+++ b/models/db/index.go
@@ -54,12 +54,13 @@ var (
)
const (
- maxDupIndexAttempts = 3
+ // MaxDupIndexAttempts max retry times to create index
+ MaxDupIndexAttempts = 3
)
// GetNextResourceIndex retried 3 times to generate a resource index
func GetNextResourceIndex(tableName string, groupID int64) (int64, error) {
- for i := 0; i < maxDupIndexAttempts; i++ {
+ for i := 0; i < MaxDupIndexAttempts; i++ {
idx, err := getNextResourceIndex(tableName, groupID)
if err == ErrResouceOutdated {
continue