这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@forty2
Copy link

@forty2 forty2 commented Jun 29, 2016

Likewise, in the event of a timeout, don't fire a 'success' if it happens to come in while processing the timeout (much less likely).

I think this is a bug -- in my experience, the old version will always fire a timeout after 15s, even when the request completes successfully. What do you think? Feel free to accept/decline/discuss as you deem appropriate.

…ewise, in the event of a timeout, don't fire a 'success' if it happens to come in while processing the timeout (much less likely).
@hobbyquaker
Copy link
Owner

hobbyquaker commented Jul 1, 2016

Hi Zach, I think we could solve this with less code, could you pls take a look at 7acc683?
In case of a successful request callback the reference in callbacks[cid] will be deleted, so I just added a check inside the setTimeout if the reference still exists. Do you think this would solve the issue also?
Regards,
Sebastian

@forty2
Copy link
Author

forty2 commented Jul 2, 2016

The only potential problem I see with not clearing the timeout is that if calling cb() takes longer than the timeout duration, both could still get called. Not sure if that's worth worrying about.

Having said that, I'm 99% sure 7acc683 will fix the problem I was seeing (I won't be able to test until Tuesday) and I'm happy to go with it.

@hobbyquaker
Copy link
Owner

replaced by bed88d5

@hobbyquaker hobbyquaker closed this Jul 2, 2016
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