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