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 stream stalling on small files. #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BlakeB415
Copy link

@BlakeB415 BlakeB415 commented Nov 3, 2021

Node: v17.0.0
OS: Windows 11

The end callback is never called on some smaller files causing the pipeline to stall. This seemed to fix it.

@timothyallan
Copy link

WHOOO What a lifesaver this was, thanks @BlakeB415. Spent ages trying to figure out why our dev boxes were hanging randomly with multer, but not production. This fixed it.

@AhmedAlSaey
Copy link

Can this PR be approved please?

@KostyaTretyak
Copy link

KostyaTretyak commented Jul 30, 2024

Although I don't have deep knowledge in streams, but I feel that the following example will be more correct:

_flush(cb) {
    this[kResult].finally(() => {
      if (this[kStream] != null) {
        this[kStream].end();
      }
      cb(null);
    });
  }

KostyaTretyak added a commit to ts-stack/multer that referenced this pull request Jul 30, 2024
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.

4 participants