Skip to content

Commit

Permalink
Return abandoned jobs to the queue.
Browse files Browse the repository at this point in the history
If a connection dies and it has a reserved job, put that job back in the queue.
  • Loading branch information
Keith Rarick committed Sep 24, 2007
1 parent 575a7a7 commit 29e2f39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions beanstalkd.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@
#define CMD_RESERVE_LEN CONSTSTRLEN(CMD_RESERVE)
#define CMD_STATS_LEN CONSTSTRLEN(CMD_STATS)

int enqueue_job(job j);

#endif /*beanstalk_h*/
2 changes: 2 additions & 0 deletions conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "conn.h"
#include "net.h"
#include "util.h"
#include "beanstalkd.h"

conn
make_conn(int fd, char start_state)
Expand Down Expand Up @@ -55,6 +56,7 @@ conn_close(conn c)
event_del(&c->evq);

close(c->fd);
if (c->reserved_job) enqueue_job(c->reserved_job);

free(c);
}

0 comments on commit 29e2f39

Please sign in to comment.