mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 17:44:59 +09:00
GO-1306: Unwatch file if it's synced
This commit is contained in:
parent
c64c6054ba
commit
8af40a081a
1 changed files with 4 additions and 0 deletions
|
@ -116,6 +116,10 @@ func (s *statusWatcher) updateFileStatus(ctx context.Context, key fileWithSpace)
|
|||
if err != nil {
|
||||
return fmt.Errorf("get file status: %w", err)
|
||||
}
|
||||
// Files are immutable, so we can stop watching status updates after file is synced
|
||||
if status == syncstatus.StatusSynced {
|
||||
s.Unwatch(key.spaceID, key.fileID)
|
||||
}
|
||||
return s.updateReceiver.UpdateTree(context.Background(), key.fileID, status)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue