storex-sync
storex-sync copied to clipboard
SharedSyncLog cleanup function
To synchronize between clients, a SharedSyncLog is used to distribute log entries. Once all devices have sent and received all log entries up to a certain point, they can be deleted.
To implement:
- Add a
doPeriodicCleanup() : Promise<void>method to the SharedSyncLog interface - In
SharedSharedSyncLogStorage.doPeriodicCleanup(), retrieve the device info for the devices of the current user - Get the minimum of the
sharedUntilvalues of those devices. - Delete all log entries before that value