-
Notifications
You must be signed in to change notification settings - Fork 80
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
Change setTimeout to setInterval #63
base: master
Are you sure you want to change the base?
Conversation
Change setTimeout to setInterval for consistent reconnection attempts. Otherwise it just tries to reconnect once and if server was not online it just hangs forever doing nothing...
This seems reasonable to me, I've run into this issue in the past and worked around it in other ways, but this PR does seem like the correct behavior. What do you think @emgee3? I can merge this, but I don't have the power to push an update to npm. |
I don't really do a whole lot of Meteor work these days @vsivsi , so while I'll help out when I can, I trust your decision on any such matters. I have added you to the people who can publish on npm. |
Great, I'll take a closer look at this in the morning and push an update to npm sometime tomorrow. |
@randomnerd Hi, I've looked into this a bit and while I understand what you are trying to achieve, it doesn't appear to be as simple as your proposed change assumes it to be. One basic issue is that this line now needs to be a The bigger issue seems to be that the existing Anyway, the change you submitted causes at least one unit test to fail here: I think for some version of this PR to be acceptable, you should to construct a mocked failing unit test for the case you are trying to address, and then use that to show your changes address that case without breaking anything else. Let me know what you think. |
Hi there. Thanks!
|
The DDP connection object is an event emitter. If you add a handlers for https://github.com/vsivsi/meteor-job-collection-playground-worker/blob/master/work.coffee#L89-L102 |
I just ran into the same underlying issue where if the server goes away, the client attempts to reconnect just once. I'm not sure I understand the point of that? The way I solved this was to remove the check for |
@rantecki I agree, something is fishy with |
Change setTimeout to setInterval for consistent reconnection attempts.
Otherwise it just tries to reconnect once and if server was not online it just hangs forever doing nothing...