multi: add reset closure to kvdb.Update
Similarly as with kvdb.View this commits adds a reset closure to the kvdb.Update call in order to be able to reset external state if the underlying db backend needs to retry the transaction.
This commit is contained in:
44 files changed
+208
-162
No files matched your search
@@ -107,7 +107,7 @@ func initOrSyncVersions(db versionedDB, init bool, versions []version) error {
|
||||
if init {
|
||||
return kvdb.Update(db.bdb(), func(tx kvdb.RwTx) error {
|
||||
return initDBVersion(tx, getLatestDBVersion(versions))
|
||||
})
|
||||
}, func() {})
|
||||
}
|
||||
|
||||
// Otherwise, ensure that any migrations are applied to ensure the data
|
||||
@@ -159,5 +159,5 @@ func syncVersions(db versionedDB, versions []version) error {
|
||||
}
|
||||
|
||||
return putDBVersion(tx, latestVersion)
|
||||
})
|
||||
}, func() {})
|
||||
}
|
||||
Reference in new issue
Block a user