mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 14:46:21 +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
|
||||
discard_on(Exception) do |error|
|
||||
ExceptionNotifier.notify_exception(error, data: { site: site.name })
|
||||
ExceptionNotifier.notify_exception(error, data: { site: @site&.name })
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,6 +9,7 @@ class BacktraceJob < ApplicationJob
|
|||
attr_reader :params
|
||||
|
||||
def perform(site:, params:)
|
||||
@site = site
|
||||
@params = params
|
||||
|
||||
unless sources.empty?
|
||||
|
|
|
@ -6,6 +6,8 @@ class ContactJob < ApplicationJob
|
|||
# @param [String]
|
||||
# @param [Hash]
|
||||
def perform(site, form_name, form, origin = nil)
|
||||
@site = site
|
||||
|
||||
# Sanitizar los valores
|
||||
form.each_key do |key|
|
||||
form[key] = ActionController::Base.helpers.sanitize form[key]
|
||||
|
|
|
@ -7,6 +7,8 @@ class GitPullJob < ApplicationJob
|
|||
# @param :usuarie [Usuarie]
|
||||
# @return [nil]
|
||||
def perform(site, usuarie)
|
||||
@site = site
|
||||
|
||||
return unless site.repository.origin
|
||||
return unless site.repository.fetch.positive?
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ class GitPushJob < ApplicationJob
|
|||
# @param :site [Site]
|
||||
# @return [nil]
|
||||
def perform(site)
|
||||
@site = site
|
||||
|
||||
site.repository.push if site.repository.origin
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue