Timeouts (Pro Only)
JoobQ allows you to prevent individual jobs or entire queues from consuming too many resources by setting timeouts and applying throttling.
Job Timeout
You can configure a timeout globally or for specific jobs to ensure that no single job runs longer than it should:
JoobQ.configure do |config|
config.timeout = 1.minute
end
Or for individual jobs:
class TimeoutJob
include JoobQ::Job
def perform
with_timeout(5.seconds) do
puts "This job will timeout if it exceeds 30 seconds."
end
end
end
Last updated
Was this helpful?