tweaks in sync timeout handling

This commit is contained in:
zadam
2020-07-28 23:29:12 +02:00
parent 5f4a84d967
commit 8a57960c6e
3 changed files with 10 additions and 4 deletions

View File

@@ -132,6 +132,9 @@ async function pullSync(syncContext) {
const startDate = Date.now();
const resp = await syncRequest(syncContext, 'GET', changesUri);
const pulledDate = Date.now();
stats.outstandingPulls = resp.maxSyncId - lastSyncedPull;
if (stats.outstandingPulls < 0) {
@@ -162,7 +165,7 @@ async function pullSync(syncContext) {
await setLastSyncedPull(rows[rows.length - 1].sync.id);
});
log.info(`Pulled and updated ${rows.length} changes from ${changesUri} in ${Date.now() - startDate}ms`);
log.info(`Pulled ${rows.length} changes in ${pulledDate - startDate}ms from ${changesUri} and applied them in ${Date.now() - pulledDate}ms`);
}
if (appliedPulls > 0) {