diff --git a/app/jobs/deploy_job.rb b/app/jobs/deploy_job.rb index 6da609cb..71d8b919 100644 --- a/app/jobs/deploy_job.rb +++ b/app/jobs/deploy_job.rb @@ -10,8 +10,6 @@ class DeployJob < ApplicationJob # Lanzar lo antes posible self.priority = 10 - # Intentar dentro de un minuto - self.retry_interval = 60 def handle_error(error) case error diff --git a/app/lib/exception_notifier/gitlab_notifier.rb b/app/lib/exception_notifier/gitlab_notifier.rb index b596bcf4..8152bb62 100644 --- a/app/lib/exception_notifier/gitlab_notifier.rb +++ b/app/lib/exception_notifier/gitlab_notifier.rb @@ -11,7 +11,12 @@ module ExceptionNotifier # @param [Exception] # @param [Hash] def call(exception, **options) - GitlabNotifierJob.perform_later(exception, **options) + case exception + when BacktraceJob::BacktraceException + GitlabNotifierJob.perform_later(exception, **options) + else + GitlabNotifierJob.perform_now(exception, **options) + end end end end diff --git a/config/environments/production.rb b/config/environments/production.rb index f13488b8..4cc1cb39 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -142,7 +142,7 @@ Rails.application.configure do } config.action_mailer.default_options = { from: ENV.fetch('DEFAULT_FROM', "noreply@sutty.nl") } - config.middleware.use ExceptionNotification::Rack, gitlab: {} + config.middleware.use ExceptionNotification::Rack, gitlab: {}, ignore_exceptions: (['DeployJob::DeployAlreadyRunningException'] + ExceptionNotifier.ignored_exceptions) Rails.application.routes.default_url_options[:host] = "panel.#{ENV.fetch('SUTTY', 'sutty.nl')}" Rails.application.routes.default_url_options[:protocol] = 'https'