date added

main
saif 2025-07-02 15:58:28 +05:00
parent 8f629b2089
commit 5518d0c975
1 changed files with 15 additions and 11 deletions

View File

@ -40,8 +40,10 @@ function getClient(region) {
if (!clients[region]) { if (!clients[region]) {
clients[region] = new SQSClient({ clients[region] = new SQSClient({
region, region,
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY, accessKeyId: process.env.AWS_ACCESS_KEY,
secretAccessKey: process.env.AWS_SECRET_KEY, secretAccessKey: process.env.AWS_SECRET_KEY,
},
}); });
} }
return clients[region]; return clients[region];
@ -208,7 +210,9 @@ async function processQueue(queue) {
} }
console.log( console.log(
`[${queue.region}] ${queue.url} -> processed ${traffics.length} messages` `[${queue.region}] ${queue.url} -> processed ${traffics.length} messages ${DateTime.now().toFormat(
"yyyy-MM-dd HH:mm:ss"
)}`
); );
} }
@ -227,7 +231,7 @@ async function runLoop() {
try { try {
await main(); // wait for current execution to finish await main(); // wait for current execution to finish
} catch (err) { } catch (err) {
console.error('Error in main():', err); console.error("Error in main():", err);
} }
// Wait 5 seconds before running again // Wait 5 seconds before running again