retry sync on timeout, even for incremental sync

This commit is contained in:
Bruno Windels 2020-09-25 10:44:29 +02:00
parent 7f0d36cf79
commit bcca23bac9

View file

@ -119,6 +119,11 @@ export class Sync {
this._status.set(SyncStatus.Syncing);
}
} catch (err) {
// retry same request on timeout
if (err.name === "ConnectionError" && err.isTimeout) {
// don't run afterSyncCompleted
continue;
}
this._status.set(SyncStatus.Stopped);
if (err.name !== AbortError) {
console.warn("stopping sync because of error");