5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 14:41:41 +00:00

fix: poder distinguir entre errores de deploy

This commit is contained in:
f 2023-03-13 17:29:13 -03:00
parent 9681f15b70
commit 866b11ff74

View file

@ -3,6 +3,7 @@
# Realiza el deploy de un sitio # Realiza el deploy de un sitio
class DeployJob < ApplicationJob class DeployJob < ApplicationJob
class DeployException < StandardError; end class DeployException < StandardError; end
class DeployTimedOutException < DeployException; end
# rubocop:disable Metrics/MethodLength # rubocop:disable Metrics/MethodLength
def perform(site, notify = true, time = Time.now) def perform(site, notify = true, time = Time.now)
@ -17,7 +18,7 @@ class DeployJob < ApplicationJob
if @site.building? if @site.building?
if 10.minutes.ago >= time if 10.minutes.ago >= time
@site.update status: 'waiting' @site.update status: 'waiting'
raise DeployException, raise DeployTimedOutException,
"#{@site.name} la tarea estuvo más de 10 minutos esperando, volviendo al estado original" "#{@site.name} la tarea estuvo más de 10 minutos esperando, volviendo al estado original"
end end