Skip to content

Commit

Permalink
Fix Omni-webhooks retry mechanism going in infinite loop (#23394)
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza98 authored Oct 20, 2021
1 parent 9db0e22 commit 872cf28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/livechat/server/lib/Livechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,9 @@ export const Livechat = {
} catch (e) {
Livechat.webhookLogger.error(`Response error on ${ 11 - attempts } try ->`, e);
// try 10 times after 10 seconds each
Livechat.webhookLogger.warn('Will try again in 10 seconds ...');
(attempts - 1) && Livechat.webhookLogger.warn('Will try again in 10 seconds ...');
setTimeout(Meteor.bindEnvironment(function() {
Livechat.sendRequest(postData, callback, attempts--);
Livechat.sendRequest(postData, callback, attempts - 1);
}), 10000);
}
},
Expand Down

0 comments on commit 872cf28

Please sign in to comment.