5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-05-04 09:37:03 +00:00

feat: hacer limpieza de emergencia #12854
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
f 2023-03-29 15:12:10 -03:00
parent cd7aa1d124
commit ae7481550a
3 changed files with 6 additions and 6 deletions

View file

@ -8,4 +8,4 @@ prometheus: bundle exec prometheus_exporter -b 0.0.0.0 --prefix "sutty_"
distributed_press_tokens_renew: bundle exec rake distributed_press:tokens:renew
cleanup: bundle exec rake cleanup:everything
stats: bundle exec rake stats:process_all
distributed_press_renew_tokens: bundle exec rake distributed_press:tokens:renew
emergency_cleanup: bundle exec rake cleanup:everything BEFORE=7

View file

@ -2,8 +2,9 @@
namespace :cleanup do
desc 'Cleanup sites'
task everything: :environment do
task everything: :environment do |_, args|
before = ENV.fetch('BEFORE', '30').to_i.days.ago
CleanupJob.perform_later(before)
end
end

View file

@ -19,7 +19,6 @@ check program stats
every "0 1 * * *"
if status != 0 then alert
check program distributed_press_tokens_renew
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv distributed_press_tokens_renew" as uid "rails" gid "www-data"
every "0 3 * * *"
if status != 0 then alert
check filesystem root with path /
if space usage > 80% for 5 times within 15 cycles then alert
if space usage > 90% for 5 cycles then exec "/usr/bin/foreman run -f /srv/Procfile -d /srv emergency_cleanup" as uid "rails" gid "www-data"