From 8c024833343073c1e9fa2b0459664082d9c9a104 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Mon, 23 Jul 2018 16:23:01 +0800 Subject: [PATCH] Add ActiveJob configuration / base class --- app/jobs/application_job.rb | 7 +++++++ config/application.rb | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 app/jobs/application_job.rb diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 000000000..d394c3d10 --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # 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 diff --git a/config/application.rb b/config/application.rb index 7b59d86f1..786ab124a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -47,6 +47,8 @@ module Zammad 'observer::_sla::_ticket_rebuild_escalation', 'observer::_transaction' + config.active_job.queue_adapter = :delayed_job + # REST api path config.api_path = '/api/v1'