seomoz / qless

Queue / Pipeline Management
MIT License
294 stars 76 forks source link

Mark a job as complete, even if it's in 'waiting' state? #177

Closed canadaduane closed 10 years ago

canadaduane commented 10 years ago

I have a job A that depends on other jobs, a1, a2, a3. Inside Qless, jobs a2 and a3 are performed, and marked as complete. Outside of the qless system, a1 is completed. How do I mark a1 as complete so that job A can start?

I've tried canceling job a1 (a1.cancel), but Qless reports

Qless::LuaScriptError: Cancel(): 77452cc87348435e98d40b33d12dd9b9 is a dependency of f95801e29d1c41b889ab35a6319f06bc but is not mentioned to be canceled

I've also tried a1.complete, but Qless reports

Qless::Job::CantCompleteError: Complete(): Job is not currently running: waiting

Is there a way forward?

dlecocq commented 10 years ago

You can explicitly remove the dependency and then cancel the job:

A.undepend(a1.jid)
a1.cancel

The A job will become unlocked immediately after the dependency is removed and then you can cancel the a1 job as you like.

canadaduane commented 10 years ago

Perfect, just what I needed. Thanks.