5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-21 17:16:22 +00:00

feat: actualizar los fediblocks todos los días

This commit is contained in:
f 2024-02-27 13:25:40 -03:00
parent df6c048882
commit 8654228edc
No known key found for this signature in database
4 changed files with 28 additions and 0 deletions

View file

@ -10,3 +10,4 @@ cleanup: bundle exec rake cleanup:everything
emergency_cleanup: bundle exec rake cleanup:everything BEFORE=7
stats: bundle exec rake stats:process_all
que: daemonize -c /srv/ -p /srv/tmp/que.pid -u rails /usr/local/bin/syslogize bundle exec que
fediblock: bundle exec rails activity_pub:fediblocks

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
class ActivityPub
# Se encarga de mantener las listas de bloqueo actualizadas
class FediblockFetchJob < ApplicationJob
def perform
ActivityPub::Fediblock.find_each do |fediblock|
fediblock.process!
rescue ActivityPub::Fediblock::FediblockDownloadError => e
ExceptionNotifier.notify_exception(e, data: { fediblock: fediblock.title })
end
end
end
end

View file

@ -0,0 +1,8 @@
# frozen_string_literal: true
namespace :activity_pub do
desc 'Update Fediblocks'
task fediblocks: :environment do |_, args|
ActivityPub::FediblockFetchJob.perform_later
end
end

View file

@ -9,6 +9,11 @@ check program distributed_press_tokens_renew
every "0 3 * * *"
if status != 0 then alert
check program fediblocks
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv fediblocks" as uid "rails" gid "www-data"
every "0 7 * * *"
if status != 0 then alert
check program access_logs
with path "/srv/http/bin/access_logs" as uid "app" and gid "www-data"
every "0 0 * * *"