Closed bjarketrux closed 7 years ago
Hi, the processJobs()
function's options
object can accept an attribute called errorCallback
. If you supply a function for this attribute, you can use it to redefine the default behavior for cases like this. Its only parameter is the error object.
See: https://github.com/vsivsi/meteor-job#q--jobprocessjobsroot-type-options-worker
D'oh simple solution! Thanks
Oh by the way the actual error message is still not shown. Is that a bug or...?
Actual: JobQueue: Error: Received error from getWork():
Expected: JobQueue: Error: Received error from getWork(): Error: DDPClient: Disconnected from DDP server
We can reopen the issue or create a new one for that.
Hmm, yes, that's a bug. I'll fix it.
The option for DDP auto_reconnect (the ddp package) seems to only be trying to reconnect once. I would like it to keep trying indefinitely and try to reconnect if connection is lost again. In this way we can start our services independently, and we can close our meteor server and start it again without the worker service crashing.
This is basically the code:
This approach works, but I get the following error when a connection is lost:
Steps to reproduce:
I investigated a bit and found that the actual exception is:
I found this by inserting a console.log in
job_class.coffe:_getWork: () ->
before@errorCallback new Error "Received error from getWork(): ", err
I have tried to new up a new DDP, but
Job.setDDP(ddp);
complains if it is called again.Thanks