Skip to content

Commit

Permalink
add in delete code
Browse files Browse the repository at this point in the history
  • Loading branch information
wendelfabianchinsamy committed Jul 24, 2024
1 parent 41f0e34 commit b0889ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/tasks/event.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b0889ff

Please sign in to comment.