mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 07:56:23 +00:00
fix: no fallar si no hay sitio #16007
This commit is contained in:
parent
53fe2847a1
commit
7a71e1de88
5 changed files with 8 additions and 1 deletions
|
@ -8,6 +8,6 @@ class ApplicationJob < ActiveJob::Base
|
||||||
|
|
||||||
# Si falla por cualquier cosa informar y descartar
|
# Si falla por cualquier cosa informar y descartar
|
||||||
discard_on(Exception) do |error|
|
discard_on(Exception) do |error|
|
||||||
ExceptionNotifier.notify_exception(error, data: { site: site.name })
|
ExceptionNotifier.notify_exception(error, data: { site: @site&.name })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,6 +9,7 @@ class BacktraceJob < ApplicationJob
|
||||||
attr_reader :params
|
attr_reader :params
|
||||||
|
|
||||||
def perform(site:, params:)
|
def perform(site:, params:)
|
||||||
|
@site = site
|
||||||
@params = params
|
@params = params
|
||||||
|
|
||||||
unless sources.empty?
|
unless sources.empty?
|
||||||
|
|
|
@ -6,6 +6,8 @@ class ContactJob < ApplicationJob
|
||||||
# @param [String]
|
# @param [String]
|
||||||
# @param [Hash]
|
# @param [Hash]
|
||||||
def perform(site, form_name, form, origin = nil)
|
def perform(site, form_name, form, origin = nil)
|
||||||
|
@site = site
|
||||||
|
|
||||||
# Sanitizar los valores
|
# Sanitizar los valores
|
||||||
form.each_key do |key|
|
form.each_key do |key|
|
||||||
form[key] = ActionController::Base.helpers.sanitize form[key]
|
form[key] = ActionController::Base.helpers.sanitize form[key]
|
||||||
|
|
|
@ -7,6 +7,8 @@ class GitPullJob < ApplicationJob
|
||||||
# @param :usuarie [Usuarie]
|
# @param :usuarie [Usuarie]
|
||||||
# @return [nil]
|
# @return [nil]
|
||||||
def perform(site, usuarie)
|
def perform(site, usuarie)
|
||||||
|
@site = site
|
||||||
|
|
||||||
return unless site.repository.origin
|
return unless site.repository.origin
|
||||||
return unless site.repository.fetch.positive?
|
return unless site.repository.fetch.positive?
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ class GitPushJob < ApplicationJob
|
||||||
# @param :site [Site]
|
# @param :site [Site]
|
||||||
# @return [nil]
|
# @return [nil]
|
||||||
def perform(site)
|
def perform(site)
|
||||||
|
@site = site
|
||||||
|
|
||||||
site.repository.push if site.repository.origin
|
site.repository.push if site.repository.origin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue