Created
June 5, 2021 01:50
-
-
Save mosufy/40ee669a8b91ac97c301132d409db3af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SQS } from 'aws-sdk'; | |
import db from './utils/db'; | |
export const sendQueue = await (payload, options) => { | |
sqs.sendMessage(payload, (error, data) => { | |
if (error) { | |
console.log('Error sending message to queue', error); | |
throw new Error(error.message); | |
} | |
console.log('Message sent', data); | |
db.insertLogRecord(queued, (errorDb, dataDb) => { | |
if (errorDb) { | |
console.log('Failed inserting log record', error); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment