Closed mf-pherlihy closed 1 year ago
I can add that. Just started using node 20 test runner and discovered the tests hang if background timers are running. That's annoying because ava didn't hang because of background timers. Like not having to use external libs for tests and coverage.
On Tue, Jun 20, 2023 at 3:11 PM Pat Herlihy @.***> wrote:
The backgroundRefreshId and cachePruneId local variables are used to create background refresh intervals behind the scenes. Unfortunately, there is no current way to clear those intervals when we want to clean things up during process termination.
This PR exposes a reset function that will reset these intervals.
You can view, comment on, or merge this pull request online at:
https://github.com/tcollinsworth/axios-cached-dns-resolve/pull/38 Commit Summary
- 6144cd4 https://github.com/tcollinsworth/axios-cached-dns-resolve/pull/38/commits/6144cd43cbfe5f2fc8b2e874ac2bef2317a7d363 Export a
reset()
function to clear active intervalsFile Changes
(2 files https://github.com/tcollinsworth/axios-cached-dns-resolve/pull/38/files)
- M axios-cached-dns-resolve.js https://github.com/tcollinsworth/axios-cached-dns-resolve/pull/38/files#diff-b39d7108df515543106c1e00c35d7d0b037c2af93614b71d1366e3a2e2e8c440 (5)
- M index.js https://github.com/tcollinsworth/axios-cached-dns-resolve/pull/38/files#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346 (1)
Patch Links:
- https://github.com/tcollinsworth/axios-cached-dns-resolve/pull/38.patch
https://github.com/tcollinsworth/axios-cached-dns-resolve/pull/38.diff
— Reply to this email directly, view it on GitHub https://github.com/tcollinsworth/axios-cached-dns-resolve/pull/38, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFYANPVTKG3N3TEXKXX64DXMHYVXANCNFSM6AAAAAAZNW4LOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
The
backgroundRefreshId
andcachePruneId
local variables are used to create background refresh intervals behind the scenes. Unfortunately, there is no current way to clear those intervals when we want to clean things up during process termination.This PR exposes a
reset
function that will reset these intervals.