mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
refactor(api): replace map[string]uint64 with api.StoreVersion for store version handling
This commit is contained in:
1 parent
e4455e936a
commit
e50c5fbe57
8 files changed
+37
-22
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package api
|
||||
|
||||
// StoreVersion records the highest processed database version for each Corrosion actor UUID.
|
||||
// A version can include changes that were superseded, so it does not guarantee that all data
|
||||
// through that version is available locally.
|
||||
type StoreVersion map[string]uint64
|
||||
|
||||
// MergeMax keeps the highest observed version for each actor in other.
|
||||
// The receiver must be initialised before calling MergeMax.
|
||||
func (v StoreVersion) MergeMax(other StoreVersion) {
|
||||
for actor, version := range other {
|
||||
v[actor] = max(v[actor], version)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user