Merge branch 'master' into fixing-upload-memory-leak

This commit is contained in:
Abhinav-grd 2021-02-25 12:34:54 +05:30
commit ac126b2e0a

View file

@ -9,6 +9,7 @@ const CryptoWorker: any =
typeof window !== 'undefined' &&
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
const ENDPOINT = getEndpoint();
const DIFF_LIMIT: number = 2500;
localForage.config({
driver: localForage.INDEXEDDB,
@ -75,7 +76,7 @@ export const syncFiles = async (token: string, collections: collection[]) => {
}
isUpdated = true;
let fetchedFiles =
(await getFiles(collection, lastSyncTime, 100, token)) ?? [];
(await getFiles(collection, lastSyncTime, DIFF_LIMIT, token)) ?? [];
files.push(...fetchedFiles);
var latestVersionFiles = new Map<number, file>();
files.forEach((file) => {
@ -151,7 +152,7 @@ export const getFiles = async (
} while (resp.data.diff.length === limit);
return await Promise.all(promises);
} catch (e) {
console.log('Get files failed' , e );
console.log('Get files failed', e);
}
};