Skip to content

Commit

Permalink
Merge pull request #1214 from egovernments/ashish-egov-patch-1
Browse files Browse the repository at this point in the history
Update Producer.ts
  • Loading branch information
ashish-egov authored Aug 2, 2024
2 parents fcca1ee + 5b00d0d commit 5a2c809
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions utilities/project-factory/src/server/kafka/Producer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const sendWithRetries = (payloads: any[], retries = 3, shutdown: boolean = false
producer.send(payloads, async (err: any) => {
if (err) {
logger.error('Error sending message:', err);
logger.debug(`Was trying to send: ${JSON.stringify(payloads)}`);
if (retries > 0) {
logger.info(`Retrying to send message. Retries left: ${retries}`);
await new Promise(resolve => setTimeout(resolve, 2000)); // wait before retrying
Expand Down

0 comments on commit 5a2c809

Please sign in to comment.