5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 11:51:42 +00:00

fix: renovar el token #13105
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

`touch` no corre `before_save`, con lo que el token nunca se renovaba
This commit is contained in:
f 2023-04-15 11:16:58 -03:00
parent 8f1c38b8fc
commit 6e56778768

View file

@ -7,7 +7,7 @@ class RenewDistributedPressTokensJob < ApplicationJob
# detener la tarea si algo pasa. # detener la tarea si algo pasa.
def perform def perform
DistributedPressPublisher.with_about_to_expire_tokens.find_each do |publisher| DistributedPressPublisher.with_about_to_expire_tokens.find_each do |publisher|
publisher.touch publisher.save
rescue DistributedPress::V1::Error => e rescue DistributedPress::V1::Error => e
data = { instance: publisher.instance, expires_at: publisher.client.token.expires_at } data = { instance: publisher.instance, expires_at: publisher.client.token.expires_at }