mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
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
This commit is contained in:
parent
d9e237e3f2
commit
d9c69596ff
7 changed files with 211 additions and 19 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue