From 1d03583b2c2ff6cea8a1b70f72ebb9beab464a8c Mon Sep 17 00:00:00 2001 From: f Date: Wed, 29 Mar 2023 15:26:23 -0300 Subject: [PATCH] fixup! feat: hacer limpieza de emergencia #12854 --- Procfile | 2 +- lib/tasks/cleanup.rake | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Procfile b/Procfile index e7f4ebb6..508a93c6 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,3 @@ cleanup: bundle exec rake cleanup:everything stats: bundle exec rake stats:process_all -emergency_cleanup: bundle exec rake cleanup:everything[7] +emergency_cleanup: bundle exec rake cleanup:everything BEFORE=7 diff --git a/lib/tasks/cleanup.rake b/lib/tasks/cleanup.rake index 6ea48c0d..20044871 100644 --- a/lib/tasks/cleanup.rake +++ b/lib/tasks/cleanup.rake @@ -3,6 +3,8 @@ namespace :cleanup do desc 'Cleanup sites' task everything: :environment do |_, args| - CleanupJob.perform_later((args.extras.first || 30).to_i.days.ago) + before = ENV.fetch('BEFORE', '30').to_i.days.ago + + CleanupJob.perform_later(before) end end