vsivsi / meteor-job-collection

A persistent and reactive job queue for Meteor, supporting distributed workers that can run anywhere.
https://atmospherejs.com/vsivsi/job-collection
Other
388 stars 68 forks source link

Change a job's status to completed #175

Closed openqubit closed 8 years ago

openqubit commented 8 years ago

I have looked at the the playground app and it makes no use of this important function

jobDone(id, runId, result, options) https://github.com/vsivsi/meteor-job-collection#jobdoneid-runid-result-options

How should one use this function to be able to mark a job stored in the mongo jobqueue as complete. My Jobs that have been done successfully are still displaying running inmyJobQueue.jobs collection.

vsivsi commented 8 years ago

https://github.com/vsivsi/meteor-job-collection-playground/blob/master/play.coffee#L84

vsivsi commented 8 years ago

Also, in the node.js worker: https://github.com/vsivsi/meteor-job-collection-playground-worker/blob/master/work.coffee#L64

You are correct, the code wouldn't work without it.

openqubit commented 8 years ago

This code job.done(once(cb, "Done")); gives Callback called! Done on the terminal,but when i check in myJobQueue.jobs collection the job status is still running instead of done.

vsivsi commented 8 years ago

When do you check? The server is not updated instantly when code runs on a client. This is an async system. Again, without the context of an entire running app to look at, I really can't help with this type of thing. It just ends up being a game of 20 questions trying to gather enough information to really help. With all of the code in front of me I can see exactly what you are trying to do.

openqubit commented 8 years ago

I check immediately a task is successfully done. Its true,iam using iron cli and router and a couple of other packages. I have a another method of updating the status but its all to hacky. Many thanks.