no agotar las conexiones
This commit is contained in:
parent
536bf78220
commit
878093d856
1 changed files with 14 additions and 12 deletions
|
@ -3,21 +3,23 @@
|
|||
# Realiza el deploy de un sitio
|
||||
class DeployJob < ApplicationJob
|
||||
def perform(site)
|
||||
site = Site.find(site)
|
||||
site.update_attribute :status, 'building'
|
||||
# Asegurarse que DeployLocal sea el primero!
|
||||
deployed = { deploy_local: deploy_local(site) }
|
||||
ActiveRecord::Base.connection_pool.with_connection do
|
||||
site = Site.find(site)
|
||||
site.update_attribute :status, 'building'
|
||||
# Asegurarse que DeployLocal sea el primero!
|
||||
deployed = { deploy_local: deploy_local(site) }
|
||||
|
||||
# No es opcional
|
||||
unless deployed[:deploy_local]
|
||||
site.update_attribute :status, 'waiting'
|
||||
raise
|
||||
end
|
||||
|
||||
deploy_others site, deployed
|
||||
notify_usuaries site, deployed
|
||||
|
||||
# No es opcional
|
||||
unless deployed[:deploy_local]
|
||||
site.update_attribute :status, 'waiting'
|
||||
raise
|
||||
end
|
||||
|
||||
deploy_others site, deployed
|
||||
notify_usuaries site, deployed
|
||||
|
||||
site.update_attribute :status, 'waiting'
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue