5
0
Fork 0
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:
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
discard_on(Exception) do |error|
ExceptionNotifier.notify_exception(error, data: { site: site.name })
ExceptionNotifier.notify_exception(error, data: { site: @site&.name })
end
end

View file

@ -9,6 +9,7 @@ class BacktraceJob < ApplicationJob
attr_reader :params
def perform(site:, params:)
@site = site
@params = params
unless sources.empty?

View file

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

View file

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

View file

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