Skip to content

Commit

Permalink
Removed thread sleep in notification throttling.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmoy12c committed Jan 27, 2024
1 parent d1697a8 commit 030056f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/bot/bot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ export class BotService {
let promises = promisesFunc.map((url) => {
return limit(() =>
fetch(url, { headers: { 'conversation-authorization': conversationToken } }).then((s) => {
this.sleep(1000);
return new Promise((resolve) => setTimeout(resolve, 1000));
}),
);
});
return await Promise.all(promises)
return await Promise.allSettled(promises)
.then((res) => {
this.logger.log(`BotService::start: Successfully pushed all pages to campaign. Time taken: ${performance.now() - startTime} milliseconds.`);
return true;
Expand Down

0 comments on commit 030056f

Please sign in to comment.