Added 'done' var to prevent this.async()() to be called twice when keepalive is true#15
Closed
amercier wants to merge 2 commits intosindresorhus:masterfrom
Closed
Added 'done' var to prevent this.async()() to be called twice when keepalive is true#15amercier wants to merge 2 commits intosindresorhus:masterfrom
amercier wants to merge 2 commits intosindresorhus:masterfrom
Conversation
Owner
|
I'm not sure. Can you reproduce your problem in a unit test? |
Contributor
Author
|
Can't reproduce the bug now. Maybe related to some other bug. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With a simple Gruntfile like this:
I have the following result when running grunt:server:keepalive:
As you can see, requests are still being sent (to check if the server is alive), even if we receive a 200 OK from the PHP server.
After a little debugging I found that calling
cb()at tasks/php.js#L63 triggers the http error event callback at tasks/php.js#L21.I haven't dug further, but this could be due to
this.asynctrying to do something while we still are in the http request callback method at tasks/php.js#L17.Well, my solution is not perfect. I would rather prefer to find out what is really occurring. Any ideas?