Skip to content

Commit

Permalink
Remove unwanted test logs (#1085)
Browse files Browse the repository at this point in the history
* Remove unwanted test logs

* Use previously_new_record? as I saw staging gives milisencond diff for created and updated datetime
  • Loading branch information
ashwinisukale authored Jan 10, 2024
1 parent 02577d9 commit 3723171
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module Indexable

included do
after_commit on: %i[create update] do
Rails.logger.info "[Event Data Import Message] After commit"
# use index_document instead of update_document to also update virtual attributes
unless %w[Prefix ProviderPrefix ClientPrefix].include?(self.class.name)
IndexJob.perform_later(self)
Expand All @@ -22,17 +21,12 @@ module Indexable
end

if instance_of?(DataciteDoi) || instance_of?(OtherDoi) || instance_of?(Doi)
Rails.logger.info "[Event Data Import Message] its a DOI #{aasm_state} #{to_jsonapi} "
if aasm_state == "findable"
changed_attributes = saved_changes
Rails.logger.info "[Event Data Import Message] changes -- #{aasm_state} -- #{changes}"
Rails.logger.info "[Event Data Import Message] saved_changes -- #{aasm_state} -- #{saved_changes}"
relevant_changes = changed_attributes.keys & %w[related_identifiers creators funding_references aasm_state]
Rails.logger.info "[Event Data Import Message] before call -- #{aasm_state} -- #{relevant_changes} --- #{(created == updated)}"
Rails.logger.info "[Event Data Import Message] dates -- #{aasm_state} -- #{created} --- #{updated} "
if relevant_changes.any? || (created == updated)
if relevant_changes.any? || previously_new_record?
send_import_message(to_jsonapi)
Rails.logger.info "[Event Data Import Message] send to Event Data service. #{aasm_state} #{to_jsonapi} "
Rails.logger.info "[Event Data Import Message] State: #{aasm_state} Params: #{to_jsonapi} message sent to Event Data service."
end
end
elsif instance_of?(Event)
Expand Down

0 comments on commit 3723171

Please sign in to comment.