@vrtmrz/livesync-commonlib 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _fetch } from "../common/coreEnvFunctions.js";
|
|
2
2
|
import { LOG_LEVEL_VERBOSE, Logger } from "octagonal-wheels/common/logger";
|
|
3
3
|
const FAST_FETCH_CHANGES_PAGE_LIMIT = 1e4;
|
|
4
|
+
const FAST_FETCH_CHANGES_PAGE_TIMEOUT_MS = 1e3;
|
|
4
5
|
class StreamingFetchFailure extends Error {
|
|
5
6
|
constructor(stage, message, retryable, options) {
|
|
6
7
|
super(message, options?.cause === void 0 ? void 0 : { cause: options.cause });
|
|
@@ -236,8 +237,7 @@ async function fetchChangesForInitialSync(downloadToDB, remoteDbUrl, authHeader,
|
|
|
236
237
|
style: "all_docs",
|
|
237
238
|
conflicts: "true",
|
|
238
239
|
revs: "true",
|
|
239
|
-
since: since.toString()
|
|
240
|
-
heartbeat: "30000"
|
|
240
|
+
since: since.toString()
|
|
241
241
|
};
|
|
242
242
|
const fetchHeaders = {
|
|
243
243
|
Accept: "application/json",
|
|
@@ -362,7 +362,8 @@ async function fetchChangesForInitialSync(downloadToDB, remoteDbUrl, authHeader,
|
|
|
362
362
|
const changesURL = setParamsToURL(new URL(`${remoteDbUrl}/_changes`), {
|
|
363
363
|
...changesBaseParams,
|
|
364
364
|
since: pageSince.toString(),
|
|
365
|
-
limit: pageLimit.toString()
|
|
365
|
+
limit: pageLimit.toString(),
|
|
366
|
+
timeout: FAST_FETCH_CHANGES_PAGE_TIMEOUT_MS.toString()
|
|
366
367
|
});
|
|
367
368
|
const response = await fetchResponse(
|
|
368
369
|
changesURL.toString(),
|