2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-07-23 08:23:01 +00:00
|
|
|
class ApplicationJob < ActiveJob::Base
|
2020-02-27 15:41:35 +00:00
|
|
|
include ApplicationJob::HasDelayedJobMonitoringCompatibilty
|
2020-03-02 09:33:37 +00:00
|
|
|
include ApplicationJob::HasQueuingPriority
|
2021-05-19 13:59:17 +00:00
|
|
|
include ApplicationJob::HasCustomLogging
|
2020-02-27 15:41:35 +00:00
|
|
|
|
2021-06-23 11:35:27 +00:00
|
|
|
ActiveJob::Logging::LogSubscriber.detach_from :active_job
|
|
|
|
|
2021-07-14 18:55:57 +00:00
|
|
|
# See config/initializers/delayed_jobs_timeout_per_job.rb for details.
|
|
|
|
def self.max_run_time
|
|
|
|
4.hours
|
|
|
|
end
|
|
|
|
|
2018-07-23 08:23:01 +00:00
|
|
|
# Automatically retry jobs that encountered a deadlock
|
|
|
|
# retry_on ActiveRecord::Deadlocked
|
|
|
|
|
|
|
|
# Most jobs are safe to ignore if the underlying records are no longer available
|
|
|
|
# discard_on ActiveJob::DeserializationError
|
|
|
|
end
|