Is it possible to have a worker exit after a certain number or processed jobs?
We are currently starting workers with a wrapper script containing:
require 'delayed/command'
Delayed::Worker.logger = Logger.new(STDOUT)
Delayed::Command.new(ARGV).daemonize
which is executed like "bundle exec ./script/delayed_job_runner --queue=${queueName} -n ${workerCount} run"
We have a use case where we would like to terminate workers after they process a number of jobs.
There doesnt appear to be a command line argument that would suit, and the queues always have jobs in them so the work till empty options will not work.
Ideally i would love to have a `--exit-after X` command line flag instead of using `Delayed::Command.new(ARGV).daemonize` or maybe wrap it in a block that can do the counting in my own codebase?