1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

save space hash

This commit is contained in:
Sergey Cherepanov 2023-01-13 19:13:26 +03:00 committed by Mikhail Iudin
parent 7794373b3c
commit ccfcc2f399
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
5 changed files with 45 additions and 10 deletions

View file

@ -63,7 +63,10 @@ func (d *diffSyncer) Init(deletionState deletionstate.DeletionState) {
func (d *diffSyncer) RemoveObjects(ids []string) {
for _, id := range ids {
d.diff.RemoveId(id)
_ = d.diff.RemoveId(id)
}
if err := d.storage.WriteSpaceHash(d.diff.Hash()); err != nil {
d.log.Error("can't write space hash", zap.Error(err))
}
}
@ -75,6 +78,9 @@ func (d *diffSyncer) UpdateHeads(id string, heads []string) {
Id: id,
Head: concatStrings(heads),
})
if err := d.storage.WriteSpaceHash(d.diff.Hash()); err != nil {
d.log.Error("can't write space hash", zap.Error(err))
}
}
func (d *diffSyncer) Sync(ctx context.Context) error {