Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT-1061 #25

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

INT-1061 #25

wants to merge 1 commit into from

Conversation

aion-tc
Copy link

@aion-tc aion-tc commented Nov 25, 2024

Fixing retry logic that "swallows" runtime errors in integrations that use Bottleneck. I added Adriana as reviewer for learning purposes.

@aion-tc aion-tc requested review from sarus and ahaias-tc November 25, 2024 12:33
Copy link
Contributor

@sarus sarus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aion-tc Thank you for the PR! The modification has to be tweaked from the ticket due to the specifics in this integration.

@@ -89,8 +89,7 @@ function doLookup(entities, options, cb) {

limiter.submit(requestEntity, entity, requestOptions, (err, result) => {
const maxRequestQueueLimitHit =
(isEmpty(err) && isEmpty(result)) ||
(err && err.message === 'This job has been dropped by Bottleneck');
((err === null || typeof err === 'undefined') && _.isEmpty(results)) || (err && err.message === 'This job has been dropped by Bottleneck');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aion-tc A few issues here due to slight differences between integrations

_ (lodash) is not defined. Instead isEmpty is imported via lodash/fp and can be directly accessed.

results is undefined here and should be result.

Final line should be:

const maxRequestQueueLimitHit =
  ((err === null || typeof err === 'undefined') && isEmpty(result)) ||
  (err && err.message === 'This job has been dropped by Bottleneck');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants