Skip to content

Commit 15671f4

Browse files
committed
Ensure function for creating rerun is only called when there are transactiosn to rerun
1 parent c0dd351 commit 15671f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/transactions.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export async function rerunTransactions(ctx) {
264264
filters = parseTransactionFilters(filters)
265265

266266
const count = await TransactionModelAPI.count(filters).exec()
267-
const pages = Math.ceil(count/taskTransactionsLength)
267+
const pages = Math.floor(count/taskTransactionsLength)
268268

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

@@ -794,4 +794,6 @@ export async function removeTransaction(ctx, transactionId) {
794794
if (process.env.NODE_ENV === 'test') {
795795
exports.calculateTransactionBodiesByteLength =
796796
calculateTransactionBodiesByteLength
797+
exports.createRerunTasks =
798+
createRerunTasks
797799
}

0 commit comments

Comments
 (0)