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

make launcher.kill() synchronous, fs.rm now gets force and maxRetries #268

Merged
merged 3 commits into from
May 31, 2022

Conversation

paulirish
Copy link
Member

per #266 there's no reason for this to be async. keeping it async adds extra challenges to both debugging and understanding the flow.

also, added a function test for userdatadir removal

for review, turn off whitespace

// backwards support for node v12 + v14.14+
// https://nodejs.org/api/deprecations.html#DEP0147
const rmSync = this.fs.rmSync || this.fs.rmdirSync;
rmSync(this.userDataDir, {recursive: true, force: true});
Copy link
Collaborator

Choose a reason for hiding this comment

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

why set force: true now?

Copy link
Member Author

Choose a reason for hiding this comment

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

if this dir doesn't exist, we want this fn call to not throw.

@paulirish paulirish merged commit 3724165 into master May 31, 2022
@paulirish paulirish deleted the sync-killtime2 branch May 31, 2022 21:18
// backwards support for node v12 + v14.14+
// https://nodejs.org/api/deprecations.html#DEP0147
const rmSync = this.fs.rmSync || this.fs.rmdirSync;
rmSync(this.userDataDir, {recursive: true, force: true, maxRetries: 10});
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you also capture the force / max retry change in the commit title

Copy link
Collaborator

Choose a reason for hiding this comment

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

oops

@paulirish paulirish changed the title make launcher.kill() synchronous make launcher.kill() synchronous, fs.rm now gets force and maxRetries May 31, 2022
@calebeby
Copy link
Contributor

calebeby commented Jun 8, 2022

@paulirish would it make sense to remove the async modifier from the kill function returned by launch() too? Happy to send a PR!

@paulirish
Copy link
Member Author

@calebeby yup sg!

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.

None yet

3 participants