Skip to content

Commit 32a4ded

Browse files
author
nkumar
committed
dynamodb payload, config changes
Committer: nkumar
1 parent cdbdfbd commit 32a4ded

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

config/default.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ module.exports = {
4848
RECONSILER_END: process.env.RECONSILER_END || 5,
4949
RECONSILER_DURATION_TYPE: process.env.RECONSILER_DURATION_TYPE || 'm'
5050
},
51+
DYNAMODB:
52+
{
53+
DYNAMODB_TABLE: process.env.DYNAMODB_TABLE || 'test_pg_ifx_payload_sync'
54+
},
5155

5256
AUTH0_URL: process.env.AUTH0_URL ,
5357
AUTH0_AUDIENCE: process.env.AUTH0_AUDIENCE ,

src/services/pushToDynamoDb.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ const _ = require('lodash')
44
var AWS = require("aws-sdk");
55
async function pushToDynamoDb(payload) {
66
try { console.log('----Push To DynomoDB -------');
7-
// console.log(payload)
8-
p_dd_payloadseqid = payload.payload.payloadseqid;
97
var params = {
10-
TableName: 'test_pg_ifx_payload_sync',
8+
TableName: config.DYNAMODB.DYNAMODB_TABLE,
119
Item: {
1210
payloadseqid: payload.payload.payloadseqid,
13-
pl_document: payload.payload,
11+
pl_document: payload,
1412
pl_table: payload.payload.table,
1513
pl_uniquecolumn: payload.payload.Uniquecolumn,
1614
pl_operation: payload.payload.operation,
@@ -25,9 +23,8 @@ async function pushToDynamoDb(payload) {
2523
});
2624

2725
} catch (e) {
28-
logger.error(`Error at PushToDynamoDB "${e}"`)
26+
logger.error(`error-sync: Error at PushToDynamoDB "${e}"`)
2927
}
3028
}
3129

32-
console.log("--from DyanomoDb--")
3330
module.exports = pushToDynamoDb

0 commit comments

Comments
 (0)