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

Do not wait for ready event if the file descriptor is already opened #1289

Merged
merged 4 commits into from May 27, 2020
Merged

Conversation

Giotino
Copy link
Collaborator

@Giotino Giotino commented May 26, 2020

got waits for the open event if the body is an fs.ReadStream even if the fd is already opened.

With this PR I added a check ReadStream.pending in order to immediately resolve waitForOpenFile if the fd is already opened.

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.
  • I have included some tests.

Fixes #1280

test/post.ts Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title Do not wait for open event if fd already opened Do not wait for ready event if the file descriptor is already opened May 27, 2020
@sindresorhus sindresorhus merged commit 2c8fe19 into sindresorhus:master May 27, 2020
@Giotino Giotino deleted the issue-1280 branch May 27, 2020 20:05
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.

Got hangs if passed a stream which has already emitted 'open'
3 participants