(ctx context.Context)
| 988 | } |
| 989 | |
| 990 | func (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 | |
| 1007 | func (db *dbCrypt) ensureEncrypted(ctx context.Context) error { |
| 1008 | return db.InTx(func(s database.Store) error { |
no test coverage detected