Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const categorizeChunk = async (categorizer, chunk) => {
const timeStart = new Date()
const categorizedTransactions = categorizer.categorize(chunk)
categorizedTransactions.forEach(t => (t.toCategorize = false))
await BankTransaction.bulkSave(categorizedTransactions, 30)
sendResultsToMatomo(categorizedTransactions)
const timeEnd = new Date()
const timeElapsed = differenceInSeconds(timeEnd, timeStart)
return timeElapsed
}