mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 00:06:21 +00:00
fix: handle_error no es compatible con activejob
This commit is contained in:
parent
ba3cc9cad9
commit
94d7b32ce6
2 changed files with 9 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue