Permalink
Browse files

Ensure the job is in a kickable state (i.e. Buried or Delayed).

  • Loading branch information...
1 parent ecfed3d commit 03d92a0912ec747e8d8091c4bb955de90f6100b4 @etanol etanol committed Oct 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 prot.c
View
3 prot.c
@@ -1421,7 +1421,8 @@ dispatch_cmd(Conn *c)
j = job_find(id);
if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD);
- if (kick_buried_job(c->srv, j) || kick_delayed_job(c->srv, j)) {
+ if ((j->r.state == Buried && kick_buried_job(c->srv, j)) ||
+ (j->r.state == Delayed && kick_delayed_job(c->srv, j))) {
reply(c, MSG_KICKED, MSG_KICKED_LEN, STATE_SENDWORD);
} else {
return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD);

0 comments on commit 03d92a0

Please sign in to comment.