Skip to content

Commit 02f5826

Browse files
author
Sachin Maheshwari
committed
cleaning...
1 parent 5865d47 commit 02f5826

File tree

2 files changed

+6
-84
lines changed

2 files changed

+6
-84
lines changed

src/producer.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ async function setupPgClient() {
2929
const payload = JSON.parse(message.payload)
3030
const validTopicAndOriginator = (pgOptions.triggerTopics.includes(payload.topic)) && (pgOptions.triggerOriginators.includes(payload.originator)) // Check if valid topic and originator
3131
if (validTopicAndOriginator) {
32-
if (isFailover) {
33-
await pushToDynamoDb(payload)
34-
} else {
32+
if (!isFailover) {
3533
await pushToKafka(payload)
3634
audit(payload)
35+
} else {
36+
await pushToDynamoDb(payload)
3737
}
3838
} else {
3939
logger.debug('Ignoring message with incorrect topic or originator')
@@ -42,7 +42,9 @@ async function setupPgClient() {
4242
} catch (error) {
4343
logger.error('Could not parse message payload')
4444
logger.debug(`error-sync: producer parse message : "${error.message}"`)
45-
//await auditTrail([pl_randonseq, 1111, 'pl_table', 'pl_uniquecolumn', 'pl_operation', "error-producer", "", "", error.message, 'pl_payload', new Date(), 'pl_topic'], 'producer')
45+
if (!isFailover) {
46+
await auditTrail([pl_randonseq, 1111, 'pl_table', 'pl_uniquecolumn', 'pl_operation', "error-producer", "", "", error.message, 'pl_payload', new Date(), 'pl_topic'], 'producer')
47+
}
4648
logger.logFullError(error)
4749
// push to slack - alertIt("slack message"
4850
}
@@ -52,7 +54,6 @@ async function setupPgClient() {
5254
logger.debug(`error-sync: producer postgres-setup 1 :"${err.message}"`)
5355
logger.error('Could not setup postgres client')
5456
logger.logFullError(err)
55-
5657
terminate()
5758
}
5859
}

src/producer_dd.js

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)