diff --git a/app/jobs/deploy_job.rb b/app/jobs/deploy_job.rb index 6dd93129..098a717e 100644 --- a/app/jobs/deploy_job.rb +++ b/app/jobs/deploy_job.rb @@ -44,6 +44,8 @@ class DeployJob < ApplicationJob end deploy_others + rescue DeployException => e + notify_exception e ensure @site&.update status: 'waiting' @@ -54,6 +56,12 @@ class DeployJob < ApplicationJob private + # @param :exception [StandardError] + # @param :deploy [Deploy] + def notify_exception(exception, deploy = nil) + ExceptionNotifier.notify_exception(exception, data: { site: @site.id, deploy: deploy&.type }) + end + def deploy_local @deploy_local ||= @site.deploys.find_by(type: 'DeployLocal') end @@ -71,7 +79,7 @@ class DeployJob < ApplicationJob status = false seconds = 0 - ExceptionNotifier.notify_exception(e, data: { site: site.id, deploy: d.type }) + notify_exception e, d end @deployed[d.type.underscore.to_sym] = {