Skip to content
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

When jobs.process was interrupted by errors, the job still in active state #53

Closed
jason-son opened this issue Aug 9, 2011 · 8 comments

Comments

@jason-son
Copy link

So how to clear those jobs state,which I wanna put them back to the Queued state.
If there could be some action in web UI is great, and API is also ok.
And also for the failed jobs.

@tj
Copy link
Contributor

tj commented Aug 9, 2011

hmm there is a API for max attempts, however that defaults to 1 so if you get an error it should stay in the failure state, is that not happening?

@jason-son
Copy link
Author

Actually,I use ctrl+c to interrupt the jobs.process scripts. So the states always to be active.
and, I wanna to run another script to attempts the failure job,but don't know how to do.

@jason-son
Copy link
Author

Got the state change

PUT '/job/:id/state/:state'
job.states()

Job.get(id, function(err, job){
if (err) return res.send({ error: err.message });
job.status(state);
job.save(function(err){
if (err) return res.send({ error: err.message });
res.send({ message: 'updated state' });
});
});

BTW, if the web UI has some action to change the state, that would be nice ~

update! found that ! just click the every job states in the web UI,which you can get selections;

@tj
Copy link
Contributor

tj commented Aug 10, 2011

yup, it's a little obscure since it's just the text, I should probably make that more obvious lol

@Qard
Copy link
Contributor

Qard commented Jan 11, 2013

Is it possible to somehow change the state of a job automatically if it's been "active" for a long period of time? I have kue running a thousand jobs at any given time. If I interrupt it, those jobs stay in the queue forever. My host kills and restarts my instances regularly, so I end up overflowing redis after about a day and have to manually clear it.

@tj
Copy link
Contributor

tj commented Jan 16, 2013

not with kue's api really, you'd have to do some direct redis stuff, or do some cron job style lua scripting etc

@Qard
Copy link
Contributor

Qard commented Jan 16, 2013

What about having another job run every hour or so that searches queued jobs with the active state and checks the updated_at field? Would that be reliable, or could updated_at be changed by other things? I assume the progress field would change it, but if no progress has been made, the same issue probably exists.

@tj
Copy link
Contributor

tj commented Jan 16, 2013

I dont think we have progress updating it ATM, I cant remember, but either way yeah that should be a good indication of a stuck job

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

No branches or pull requests

3 participants