5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 08:06:23 +00:00

fix: no fallar si no hay sitio #16007

This commit is contained in:
f 2024-04-12 15:31:47 -03:00
parent 53fe2847a1
commit 7a71e1de88
No known key found for this signature in database
5 changed files with 8 additions and 1 deletions

View file

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

View file

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

View file

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

View file

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

View file

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