mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-21 13:06:21 +00:00
feat: actualizar los fediblocks todos los días
This commit is contained in:
parent
df6c048882
commit
8654228edc
4 changed files with 28 additions and 0 deletions
1
Procfile
1
Procfile
|
@ -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
|
||||
|
|
14
app/jobs/activity_pub/fediblock_fetch_job.rb
Normal file
14
app/jobs/activity_pub/fediblock_fetch_job.rb
Normal 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
|
8
lib/tasks/activity_pub.rake
Normal file
8
lib/tasks/activity_pub.rake
Normal 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
|
|
@ -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 * * *"
|
||||
|
|
Loading…
Reference in a new issue