mirror of
https://github.com/rowyio/rowy.git
synced 2026-07-13 05:48:53 +02:00
added delay between export csv chunk files
This commit is contained in:
1
www/.bashrc
Normal file
1
www/.bashrc
Normal file
@@ -0,0 +1 @@
|
||||
export NODE_OPTIONS=--max_old_space_size=4096
|
||||
@@ -21,7 +21,11 @@ import { SnackContext } from "contexts/snackContext";
|
||||
import { useFiretableContext } from "contexts/firetableContext";
|
||||
import { db } from "../../firebase";
|
||||
import { FieldType } from "constants/fields";
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
const ITEM_HEIGHT = 48;
|
||||
const ITEM_PADDING_TOP = 8;
|
||||
const MenuProps = {
|
||||
@@ -181,10 +185,13 @@ export default function ExportCSV() {
|
||||
return all;
|
||||
}, []);
|
||||
console.log(docChunks.length);
|
||||
|
||||
docChunks.forEach((element, index) => {
|
||||
await asyncForEach(docChunks, async (element, index) => {
|
||||
await setTimeout(() => {
|
||||
console.log(`saving part${index + 1}`);
|
||||
}, 3000);
|
||||
saveDocs2CSV(element, index, docChunks.length);
|
||||
});
|
||||
|
||||
// generate csv Data
|
||||
}
|
||||
const saveDocs2CSV = (docs, index, chunksLength) => {
|
||||
|
||||
Reference in New Issue
Block a user