diff --git a/src/lib/api/garden.ts b/src/lib/api/garden.ts index b404f5e4..b01fe4e3 100644 --- a/src/lib/api/garden.ts +++ b/src/lib/api/garden.ts @@ -42,7 +42,7 @@ export const getGarden = async (id: string) => { }; export const getAllListedGardens = async () => { - const CHUNK_SIZE = 500; + const CHUNK_SIZE = 1000; // To prevent endless loops in case of unexpected problems or bugs // Note: this leads to the loop breaking once this number of gardens is reached! const LOOP_LIMIT_ITEMS = 100000; @@ -81,7 +81,7 @@ export const getAllListedGardens = async () => { ); // Wait 1000ms seconds before fetching the next chunk - await new Promise((resolve) => setTimeout(() => resolve(), 1500)); + await new Promise((resolve) => setTimeout(() => resolve(), 500)); } while (startAfterDoc != null && iteration < LOOP_LIMIT_ITEMS / CHUNK_SIZE); isFetchingGardens.set(false);