SQLStore: Optionally retry queries if sqlite returns database is locked (#56096)
* SQLStore: Retry queries if sqlite returns database is locked * Configurable retries * Apply suggestions from code review Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
This commit is contained in:
co-authored by
Christopher Moyer
parent
920d2aa599
commit
46fb4081ba
@@ -36,7 +36,7 @@ func (ss *SQLStore) createOrg(ctx context.Context, name string, userID int64, en
|
||||
Created: time.Now(),
|
||||
Updated: time.Now(),
|
||||
}
|
||||
if err := inTransactionWithRetryCtx(ctx, engine, ss.bus, func(sess *DBSession) error {
|
||||
if err := ss.inTransactionWithRetryCtx(ctx, engine, ss.bus, func(sess *DBSession) error {
|
||||
if isNameTaken, err := isOrgNameTaken(name, 0, sess); err != nil {
|
||||
return err
|
||||
} else if isNameTaken {
|
||||
|
||||
Reference in New Issue
Block a user