I run beanstalkd
as a service using the standard /etc/default/beanstalkd
.
Sometimes my code throws a NOT_FOUND
error when I try to delete a job, because it got released due to exceeding the TTR. I would like to increase the TTR for all jobs that get inserted into the tubes.
Is there a way to set a default TTR for beanstalkd
jobs? My guess is that I can change this somewhere in /etc/default/beanstalkd, but I couldn't find this in the beanstalkd
docs.
There isn't a way to set a global default, in /etc/default/beanstalkd or elsewhere, but it is easy enough to setup a wrapper function/class that all jobs are funnelled through to then be inserted to the queue, that would set a TTR (the parameter to the PUT command), if it was not specifically set.
In beanstalkc, that would override/replace the put
function.
def put(self, body, priority=DEFAULT_PRIORITY, delay=0, ttr=DEFAULT_TTR):