mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-21 12:11:46 +00:00
feat: hacer limpieza de emergencia #12854
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
cd7aa1d124
commit
ae7481550a
3 changed files with 6 additions and 6 deletions
2
Procfile
2
Procfile
|
@ -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
|
distributed_press_tokens_renew: bundle exec rake distributed_press:tokens:renew
|
||||||
cleanup: bundle exec rake cleanup:everything
|
cleanup: bundle exec rake cleanup:everything
|
||||||
stats: bundle exec rake stats:process_all
|
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
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
namespace :cleanup do
|
namespace :cleanup do
|
||||||
desc 'Cleanup sites'
|
desc 'Cleanup sites'
|
||||||
task everything: :environment do
|
task everything: :environment do |_, args|
|
||||||
before = ENV.fetch('BEFORE', '30').to_i.days.ago
|
before = ENV.fetch('BEFORE', '30').to_i.days.ago
|
||||||
|
|
||||||
CleanupJob.perform_later(before)
|
CleanupJob.perform_later(before)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,6 @@ check program stats
|
||||||
every "0 1 * * *"
|
every "0 1 * * *"
|
||||||
if status != 0 then alert
|
if status != 0 then alert
|
||||||
|
|
||||||
check program distributed_press_tokens_renew
|
check filesystem root with path /
|
||||||
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv distributed_press_tokens_renew" as uid "rails" gid "www-data"
|
if space usage > 80% for 5 times within 15 cycles then alert
|
||||||
every "0 3 * * *"
|
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"
|
||||||
if status != 0 then alert
|
|
||||||
|
|
Loading…
Reference in a new issue