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

feat: clear intervals on shutdown #378

Merged
merged 4 commits into from
Oct 21, 2019
Merged

feat: clear intervals on shutdown #378

merged 4 commits into from
Oct 21, 2019

Conversation

scttcper
Copy link
Contributor

@scttcper scttcper commented Oct 18, 2019

after shutting down a circuit breaker, these status intervals are persisted and continue to run. This keeps track of each interval and shuts them down.

Edit: attempting to fix the following warning from jest when using jest --detectOpenHandles

Jest has detected the following 2 open handles potentially keeping Jest from exiting:

  ●  Timeout



      at new Status (node_modules/opossum/lib/status.js:65:20)
      at new CircuitBreaker (node_modules/opossum/lib/circuit.js:119:20)

Copy link
Contributor

@tjenkinson tjenkinson left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

In general this looks good to me. Thanks for the contribution. I'm trying to think of a good way to add a test for this, but it's not really obvious without introducing mocks into the tests. 🤔

Please change EMIT_INTERVAL to SNAPSHOT_INTERVAL.

@lholmquist lholmquist self-requested a review October 21, 2019 12:45
@lance lance merged commit 91e2dbe into nodeshift:master Oct 21, 2019
@lance
Copy link
Member

lance commented Oct 21, 2019

@scttcper thanks for the contrib!

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.

4 participants