feat: add env to active skip transaction feature
parent
e92f325807
commit
94baf956dd
|
@ -31,6 +31,9 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
|||
) {}
|
||||
|
||||
async handle(event: ChangeDocEvent) {
|
||||
const envSkipTransaction = process.env.SKIP_TRANSACTION_FEATURE ?? 'false';
|
||||
const activeSkipTransaction = envSkipTransaction == 'true';
|
||||
|
||||
const apmTransactions = apm.startTransaction(
|
||||
`ChangeDocEvent ${event?.data?.database}`,
|
||||
'handler',
|
||||
|
@ -107,6 +110,7 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
|||
// Check if this transaction should be sent to the "black hole" (not saved)
|
||||
// This is only applicable for SETTLED transactions
|
||||
const shouldSkipSaving =
|
||||
activeSkipTransaction &&
|
||||
data.status === STATUS.SETTLED &&
|
||||
(await this.formulaService.sentToBlackHole());
|
||||
|
||||
|
|
Loading…
Reference in New Issue