From 9ff448f5cb7a47e628a022f0409dbce7b435bed7 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 30 Aug 2023 10:10:46 +0700 Subject: [PATCH] fix: use transaction when update event --- src/services/job/reassign_msg_index_to_event.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/job/reassign_msg_index_to_event.service.ts b/src/services/job/reassign_msg_index_to_event.service.ts index 9c76125dc..fb142b349 100644 --- a/src/services/job/reassign_msg_index_to_event.service.ts +++ b/src/services/job/reassign_msg_index_to_event.service.ts @@ -97,7 +97,7 @@ export default class JobReAssignMsgIndexToEvent extends BullableService { throw new Error('order attribute is wrong'); } else { eventPatches.push( - knex.raw( + trx.raw( 'UPDATE EVENT SET tx_msg_index = :tx_msg_index WHERE id = :id', { tx_msg_index: rawEvents[index].msg_index ?? null,