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

Fix unref error #400

Merged
merged 3 commits into from
Dec 18, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ const setKillTimeout = (kill, signal, options, killResult) => {
}

const timeout = getForceKillAfterTimeout(options);
setTimeout(() => {
const t = setTimeout(() => {
kill('SIGKILL');
}, timeout).unref();
}, timeout);

if (t.unref) {
mifi marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Owner

Choose a reason for hiding this comment

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

@ehmicky This still needs a code comment about why it's guarded. For example:

Guarded because there's no .unref when execa is used in the renderer process in Electron.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oops, I thought this was ok to merge, sorry about that.
I've added the comment in #401.

t.unref();
}
};

const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => {
Expand Down