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

fix: handle_error no es compatible con activejob

This commit is contained in:
f 2024-04-09 14:16:01 -03:00
parent ba3cc9cad9
commit 94d7b32ce6
No known key found for this signature in database
2 changed files with 9 additions and 8 deletions

View file

@ -4,6 +4,11 @@
class ApplicationJob < ActiveJob::Base
include Que::ActiveJob::JobExtensions
# Si falla por cualquier cosa informar y descartar
discard_on(Exception) do |error|
ExceptionNotifier.notify_exception(error, data: { site: site.name })
end
private
def site

View file

@ -3,17 +3,13 @@
# Permite pushear los cambios cada vez que se
# hacen commits en un sitio
class GitPushJob < ApplicationJob
attr_reader :site
# @param :site [Site]
# @return [nil]
def perform(site)
@site = site
site.repository.push if site.repository.origin
end
# Reportar una sola vez para que podamos resolver el problema, pero
# reportarlo igual.
#
# @return [Bool]
def handle_error(_)
expire
end
end