From b0889fff6e41492666c241ca9dd2d2ac7485563e Mon Sep 17 00:00:00 2001 From: Wendel Fabian Chinsamy Date: Wed, 24 Jul 2024 09:50:03 +0200 Subject: [PATCH] add in delete code --- lib/tasks/event.rake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tasks/event.rake b/lib/tasks/event.rake index 77199b1c2..2e6fd5323 100644 --- a/lib/tasks/event.rake +++ b/lib/tasks/event.rake @@ -105,11 +105,13 @@ namespace :gbif_events do index = ENV["INDEX"] query = "+subj.registrantId:datacite.gbif.gbif +relation_type_id:references -source_doi:(\"10.15468/QJGWBA\" OR \"10.35035/GDWQ-3V93\" OR \"10.15469/3XSWXB\" OR \"10.15469/UBP6QO\" OR \"10.35000/TEDB-QD70\" OR \"10.15469/2YMQOZ\")" label = "DeleteOrphanedGbifEventsJob_#{Time.now.utc.strftime("%d%m%Y%H%M%S")}" + Rails.logger.info("#{label}: index: #{index}") Rails.logger.info("#{label}: query: #{query}") - # response = Event.delete_by_query(index: index, query: query) - # Rails.logger.info("#{label}: #{response.as_json}") + response = Event.delete_by_query(index: index, query: query) + + Rails.logger.info("#{label}: #{response.as_json}") end end