-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Should minimumWait
be maximumWait
?
#32
Comments
// @jakobo |
Consider the following:
At registration, this is the minimum time the hook will be waiting for. In the original PR we went back and forth on the name. I agree it feels confusing (even still). I see two solutions, one of which would bump the major version
I'm leaning towards the first option. In 2 weeks, node lts rotates (Sept 11 specifically). I'd prefer to bundle this change with the end of node16 support & encourage people to stay on top of supported node versions. (Edit. From 📱) |
There's been ongoing discussion in the original PR and in sindresorhus#32 about naming the "wait" value. At registration time, it's the minimum amount of time a function waits, but at `gracefulExit`, it's the largest minimum wait value. To eliminate this confusion, the option was renamed to "wait" and the documentation was updated to reflect this. Because this is a breaking change, we're also co-introducing the LTS changes. They can be split off into a separate PR if desired, but it did not add subtantial complexity to this PR. BREAKING CHANGES: * `minimumWait` is now `wait` * Package requires Node 18+ (currently supported LTS)
@iwestlin Draft PR is at #33 if you'd like to take a look; it specifically addresses option 1, moving the minimum required node version to 18 and renaming to |
Hi, I'm not sure what does minimum mean, even if there is only one registered hook with // Force exit if we exceeded our wait value
const asyncTimer = setTimeout(() => {
done(true);
}, forceAfter);
await Promise.all(promises);
clearTimeout(asyncTimer);
done();
All in all, the maximum waiting time will be |
Ah, I think I get it... When one hook was added with I agree it's very confusing, simply call it |
You could, but that would shift the responsibility for knowing each hook's timeout to the developer calling
|
There's been ongoing discussion in the original PR and in sindresorhus#32 about naming the "wait" value. At registration time, it's the minimum amount of time a function waits, but at `gracefulExit`, it's the largest minimum wait value. To eliminate this confusion, the option was renamed to "wait" and the documentation was updated to reflect this. Because this is a breaking change, we're also co-introducing the LTS changes. They can be split off into a separate PR if desired, but it did not add subtantial complexity to this PR. BREAKING CHANGES: * `minimumWait` is now `wait` * Package requires Node 18+ (currently supported LTS)
There's been ongoing discussion in the original PR and in sindresorhus#32 about naming the "wait" value. At registration time, it's the minimum amount of time a function waits, but at `gracefulExit`, it's the largest minimum wait value. To eliminate this confusion, the option was renamed to "wait" and the documentation was updated to reflect this. Because this is a breaking change, we're also co-introducing the LTS changes. They can be split off into a separate PR if desired, but it did not add subtantial complexity to this PR. BREAKING CHANGES: * `minimumWait` is now `wait` * Package requires Node 18+ (currently supported LTS)
There's been ongoing discussion in the original PR and in sindresorhus#32 about naming the "wait" value. At registration time, it's the minimum amount of time a function waits, but at `gracefulExit`, it's the largest minimum wait value. To eliminate this confusion, the option was renamed to "wait" and the documentation was updated to reflect this. Because this is a breaking change, we're also co-introducing the LTS changes. They can be split off into a separate PR if desired, but it did not add subtantial complexity to this PR. BREAKING CHANGES: * `minimumWait` is now `wait` * Package requires Node 18+ (currently supported LTS)
Fixed by #33 |
exit-hook/index.js
Line 46 in 34078d9
Node will exit at (or before)
forceAfter
ms, so I think it should calledmaximumWait
.The text was updated successfully, but these errors were encountered: