5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 16:06:22 +00:00

deploys sin notificar

This commit is contained in:
f 2021-04-11 16:45:26 -03:00
parent 6e9b333cd5
commit 6712393393

View file

@ -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