Skip to content

Release the holder if the response has finished#17

Merged
delvedor merged 2 commits intomasterfrom
release
Jan 20, 2018
Merged

Release the holder if the response has finished#17
delvedor merged 2 commits intomasterfrom
release

Conversation

@delvedor
Copy link
Copy Markdown
Member

As titled.

@delvedor delvedor requested a review from mcollina January 20, 2018 16:15
@delvedor delvedor mentioned this pull request Jan 20, 2018
4 tasks
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM. Is this affecting benchmarks at all?

@delvedor
Copy link
Copy Markdown
Member Author

@mcollina I didn't check, but since we are adding just an if condition (which is just a boolean check) it should not affect the performances.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

This should be documented somewhere. Also, what would happen if next() is called twice or after release().

@delvedor
Copy link
Copy Markdown
Member Author

Also, what would happen if next() is called twice or after release().

If you call twice next() you will get Cannot read property 'originalUrl' of null.

This should be documented somewhere.

Document what?
If a previous middleware calls res.end the next one will never run? Shouldn't this be implicit? 🤔

@mcollina
Copy link
Copy Markdown
Member

mcollina commented Jan 20, 2018 via email

@delvedor delvedor merged commit 4897ab8 into master Jan 20, 2018
@delvedor delvedor deleted the release branch January 20, 2018 16:49
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.

2 participants