Skip to content

Commit

Permalink
Merge pull request #1265 from datacite/add_data_import_exclusion
Browse files Browse the repository at this point in the history
Add new check to exclude specific prefixes from generating events
  • Loading branch information
richardhallett authored Oct 17, 2024
2 parents b77760a + d30e054 commit 0d5b6e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Indexable
if aasm_state == "findable"
changed_attributes = saved_changes
relevant_changes = changed_attributes.keys & %w[related_identifiers creators funding_references aasm_state]
if relevant_changes.any? || (created == updated)
if relevant_changes.any? || (created == updated) && !ENV["EXCLUDE_PREFIXES_FROM_DATA_IMPORT"].to_s.split(",").include?(prefix)
send_import_message(to_jsonapi)
Rails.logger.info "[Event Data Import Message] State: #{aasm_state} Params: #{to_jsonapi} message sent to Event Data service."
end
Expand Down
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
ENV["HANDLES_MINTED"] ||= "10132"
ENV["REALM"] ||= ENV["API_URL"]
ENV["SQS_PREFIX"] ||= ""
ENV["EXCLUDE_PREFIXES_FROM_DATA_IMPORT"] ||= ""

module Lupo
class Application < Rails::Application
Expand Down

0 comments on commit 0d5b6e6

Please sign in to comment.