From 16c6c0e8d1f656f5e9d8f5d5814b7ff62b591db7 Mon Sep 17 00:00:00 2001 From: Stefan Wrobel Date: Thu, 4 Jan 2024 08:40:18 -0800 Subject: [PATCH] Don't prune old buoy reports --- lib/tasks/cleanup.rake | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/tasks/cleanup.rake b/lib/tasks/cleanup.rake index d1febac..b3b46ed 100644 --- a/lib/tasks/cleanup.rake +++ b/lib/tasks/cleanup.rake @@ -15,7 +15,6 @@ namespace :cleanup do delete from api_requests where created_at < now() - interval '7 day' and service = 'SurflineV2Lotus' and not exists(select from surfline_v2_lotus where api_request_id = api_requests.id); delete from api_requests where created_at < now() - interval '7 day' and service = 'SurflineLola' and not exists(select from surfline_lolas where api_request_id = api_requests.id); delete from api_requests where created_at < now() - interval '7 day' and service = 'SurflineNearshore' and not exists(select from surfline_nearshores where api_request_id = api_requests.id); - delete from api_requests where created_at < now() - interval '7 day' and service = 'BuoyReport' and not exists(select from buoy_reports where api_request_id = api_requests.id); SQL Rails.logger.info "Finished pruning ApiRequests in #{distance_of_time_in_words_to_now(start_time)}" end @@ -29,7 +28,6 @@ namespace :cleanup do Msw.unscoped.past.delete_all SpitcastV1.unscoped.past.delete_all SpitcastV2.unscoped.past.delete_all - BuoyReport.unscoped.past.delete_all Rake::Task['cleanup:prune_api_requests'].invoke end