Skip to content

Use fs.closeSync - #22172

Closed
Ruben Bridgewater (BridgeAR) wants to merge 1 commit into
microsoft:masterfrom
BridgeAR:fix-no-callback
Closed

Use fs.closeSync#22172
Ruben Bridgewater (BridgeAR) wants to merge 1 commit into
microsoft:masterfrom
BridgeAR:fix-no-callback

Conversation

@BridgeAR

Copy link
Copy Markdown

Switch to fs.closeSync over fs.close, otherwise this will fail when used with Node.js 10.x.
See nodejs/node#18668

Comment thread lib/tsserver.js
};
Logger.prototype.close = function () {
if (this.fd >= 0) {
fs.close(this.fd);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not just add an empty handler instead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Because errors will be silently swallowed that way. I can of course do that but I do not feel like that is a good idea.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because errors will be silently swallowed that way.

that was the intention anyways.. we are killing the server, we want to try to write to the log if we can, but if we fail, not sure we have much recourse here, the process is dying anyways.

@mhegazy

Copy link
Copy Markdown
Contributor

closing in favor of #22405

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants