Skip to content

Commit

Permalink
Issue 1317 - Fabrica doi count sync issues. (Adding log messages for …
Browse files Browse the repository at this point in the history
…debugging.)
  • Loading branch information
svogt0511 committed Sep 21, 2021
1 parent 2217fd5 commit 8ff1196
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,22 @@ def to_jsonapi
"deleted_at" => deleted_at ? deleted_at.iso8601 : nil,
}

Rails.logger.info "SKV - TO_JSONAPI BEGIN: uid, doi_counts, dois_total, dois_current_year, dois_last_year"
Rails.logger.info uid
Rails.logger.info doi_counts
Rails.logger.info dois_total
Rails.logger.info dois_current_year
Rails.logger.info dois_last_year
Rails.logger.info "SKV - TO_JSONAPI MIDDLE: attributes"
Rails.logger.info attributes
Rails.logger.info "SKV - TO_JSONAPI END"

{ "id" => symbol.downcase, "type" => "clients", "attributes" => attributes }
end

def self.export(query: nil)
Rails.logger.info "SKV - EXPORTING CLIENTS - BEGIN"

# Loop through all clients
i = 0
page = { size: 1_000, number: 1 }
Expand All @@ -674,6 +686,9 @@ def self.export(query: nil)
page_num += 1
end

Rails.logger.info query
Rails.logger.info "SKV - EXPORTING CLIENTS - END"

"#{i} clients exported."
end

Expand Down

0 comments on commit 8ff1196

Please sign in to comment.