From c4bece924136894102776c4e1037e9af48a246a8 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 4 Jan 2021 22:00:58 +0100 Subject: [PATCH] report total number of dois not indexed. #690 --- app/models/client.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/client.rb b/app/models/client.rb index 791f376e6..1a6538910 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -707,7 +707,12 @@ def self.export_doi_counts(query: nil) csv = [CSV.generate_line(headers)] + rows - Rails.logger.warn "Found #{csv.size - 1} repositories with missing DOIs." + total_missing = rows.reduce(0) do |sum, row| + sum = sum + row.split(",").last.to_i + sum + end + + Rails.logger.warn "Found #{csv.size - 1} repositories with #{total_missing} missing DOIs." csv.join("") end