Fix memory usage by batching syncTasks

This commit is contained in:
Jamie Kyle 2024-12-04 14:03:29 -08:00 committed by GitHub
parent ab1e6f847d
commit 4027f4604f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 154 additions and 75 deletions

View file

@ -845,7 +845,10 @@ type WritableInterface = {
removeSyncTaskById: (id: string) => void;
saveSyncTasks: (tasks: Array<SyncTaskType>) => void;
getAllSyncTasks: () => Array<SyncTaskType>;
dequeueOldestSyncTasks: (previousRowId: number | null) => {
tasks: Array<SyncTaskType>;
lastRowId: number | null;
};
getAllUnprocessedIds: () => Array<string>;
getUnprocessedByIdsAndIncrementAttempts: (