Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
AgentUtils.getQueueUrl(process.env.GTM_SQS_PENDING_QUEUE).then(function(data) {
pendingUrl = data;
systemConfig.pendingQueue = {};
systemConfig.pendingQueue.url = pendingUrl;
pendingQueueHandler = Consumer.create({
queueUrl: pendingUrl,
region: process.env.GTM_AWS_REGION,
messageAttributeNames: Event.requiredAttributes,
handleMessage: async (message, done) => {
let startTime = new Date().getTime();
log.info('## == NEW EVENT ==================================');
log.info('Received Message from Pending Queue');
log.debug(`message: ${json.plain(message)}`);
let event;
try {
event = new Event(message);
} catch (e) {
log.error(e);
done(); //todo dead letter queue here rather than discard
AgentUtils.getQueueUrl(process.env.GTM_SQS_PENDING_QUEUE).then(function(data) {
pendingUrl = data;
systemConfig.pendingQueue = {};
systemConfig.pendingQueue.url = pendingUrl;
pendingQueueHandler = Consumer.create({
queueUrl: pendingUrl,
region: process.env.GTM_AWS_REGION,
messageAttributeNames: Event.requiredAttributes,
handleMessage: async (message, done) => {
log.info('## == NEW EVENT ==================================');
log.info('Received Message from Pending Queue');
log.debug(`message: ${json.plain(message)}`);
let event;
try {
event = new Event(message);
} catch (e) {
log.error(e);
done(); //todo dead letter queue here rather than discard
return;