Skip to content

Commit

Permalink
Ensure function for creating rerun is only called when there are tran…
Browse files Browse the repository at this point in the history
…sactiosn to rerun
  • Loading branch information
bradsawadye committed Oct 10, 2022
1 parent c0dd351 commit 15671f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export async function rerunTransactions(ctx) {
filters = parseTransactionFilters(filters)

const count = await TransactionModelAPI.count(filters).exec()
const pages = Math.ceil(count/taskTransactionsLength)
const pages = Math.floor(count/taskTransactionsLength)

createRerunTasks(filters, batchSize, ctx.authenticated.email, 0, pages, pauseQueue, taskTransactionsLength)

Expand Down Expand Up @@ -794,4 +794,6 @@ export async function removeTransaction(ctx, transactionId) {
if (process.env.NODE_ENV === 'test') {
exports.calculateTransactionBodiesByteLength =
calculateTransactionBodiesByteLength
exports.createRerunTasks =
createRerunTasks
}

0 comments on commit 15671f4

Please sign in to comment.