MCPcopy Index your code
hub / github.com/coder/coder / ensureEncryptedWithRetry

Method ensureEncryptedWithRetry

enterprise/dbcrypt/dbcrypt.go:990–1005  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

988}
989
990func (db *dbCrypt) ensureEncryptedWithRetry(ctx context.Context) error {
991 var err error
992 for i := 0; i < 3; i++ {
993 err = db.ensureEncrypted(ctx)
994 if err == nil {
995 return nil
996 }
997 // If we get a serialization error, then we need to retry.
998 if !database.IsSerializedError(err) {
999 return err
1000 }
1001 // otherwise, retry
1002 }
1003 // If we get here, then we ran out of retries
1004 return err
1005}
1006
1007func (db *dbCrypt) ensureEncrypted(ctx context.Context) error {
1008 return db.InTx(func(s database.Store) error {

Callers 1

NewFunction · 0.95

Calls 2

ensureEncryptedMethod · 0.95
IsSerializedErrorFunction · 0.92

Tested by

no test coverage detected