1
0
Fork 0
mirror of synced 2024-06-29 19:41:03 +12:00

Merge pull request #3019 from Budibase/fix/large-csv-import

Fix performance of importing large CSVs
This commit is contained in:
Andrew Kingston 2021-10-15 15:49:11 +01:00 committed by GitHub
commit 2fbb048b0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,4 @@
const CouchDB = require("../../../db")
const linkRows = require("../../../db/linkedRows")
const csvParser = require("../../../utilities/csvParser")
const {
getRowParams,
@ -93,19 +92,10 @@ exports.handleDataImport = async (appId, user, table, dataImport) => {
}
}
// make sure link rows are up to date
finalData.push(
linkRows.updateLinks({
appId,
eventType: linkRows.EventType.ROW_SAVE,
row,
tableId: row.tableId,
table,
})
)
finalData.push(row)
}
await db.bulkDocs(await Promise.all(finalData))
await db.bulkDocs(finalData)
let response = await db.put(table)
table._rev = response._rev
}