Log to stdout because we now run workers under systemd and we want errors to go to the journal, not to log/production.log.
16 lines
494 B
Ruby
16 lines
494 B
Ruby
require 'delayed/plugin'
|
|
|
|
class DelayedJobTimeoutPlugin < ::Delayed::Plugin
|
|
callbacks do |lifecycle|
|
|
lifecycle.before(:execute) do |job|
|
|
Delayed::Job.connection.execute "set statement_timeout = 0"
|
|
end
|
|
end
|
|
end
|
|
|
|
Delayed::Worker.logger = Logger.new(STDOUT, level: :debug)
|
|
Delayed::Worker.default_queue_name = "default"
|
|
Delayed::Worker.destroy_failed_jobs = false
|
|
Delayed::Worker.plugins << DelayedJobTimeoutPlugin
|
|
Delayed::Job.include(Danbooru::Paginator::ActiveRecordExtension)
|