diff --git a/app/jobs/deploy_job.rb b/app/jobs/deploy_job.rb index 7f42e306..98e474ac 100644 --- a/app/jobs/deploy_job.rb +++ b/app/jobs/deploy_job.rb @@ -5,7 +5,7 @@ class DeployJob < ApplicationJob class DeployException < StandardError; end # rubocop:disable Metrics/MethodLength - def perform(site) + def perform(site, notify = true) ActiveRecord::Base.connection_pool.with_connection do @site = Site.find(site) @site.update_attribute :status, 'building' @@ -15,14 +15,14 @@ class DeployJob < ApplicationJob # No es opcional unless @deployed[:deploy_local] @site.update_attribute :status, 'waiting' - notify_usuaries + notify_usuaries if notify # Hacer fallar la tarea raise DeployException, deploy_local.build_stats.last.log end deploy_others - notify_usuaries + notify_usuaries if notify @site.update_attribute :status, 'waiting' end end