Closed adamrensel-artera closed 8 months ago
CLA Assistant Lite bot CLA CHECK All Contributors have signed the CLA
I have read the CLA Document and I hereby sign the CLA
recheck
Thanks for the PR, it's appreciated, I'll take a look at this by Monday.
Code Climate has analyzed commit 3926fb69 and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 100.0% (80% is the threshold).
This pull request will bring the total coverage in the repository to 96.9% (0.0% change).
View more on Code Climate.
Released as v7.4.0-canary.0, we'll be testing that version and then release it as 7.4.0 once we're happy with the changes.
Resolves https://github.com/bbc/sqs-consumer/issues/389
Description: This bug was originally closed, but I've been running into a related issue. Basically we want to start and stop a consumer based on a feature flag while using the
abort
option on.stop
. The singletonAbortController
makes it impossible to restart an aborted consumer, even if the consumer is recreated. This results in the abort signal persisting and being sent into any following AWS SDK calls.This PR creates a new
AbortController
each time the consumer is started, which results in a fresh abort signal and allows the consumer to restart. I've also removed the previouscontroller.ts
file as it's no longer used.I've also added an associated test that fails without these changes that demonstrates how the abort signal is being passed to the AWS SDK
.send
method. Thanks!Type of change:
Why is this change required?: A simple explanation of what the problem is and how this PR solves it
Code changes:
Checklist: