hyrax
hyrax copied to clipboard
Ensuring Hyrax::UserStatImporter returns false on exception
Backport of #5874
Prior to this commit, in the retriable block, if we hit an exception, we'd return true and upstream we'd raise an exception.
In the below code, the extract_stats_for is returning true, because calls to Rails.logger.info return true.
view_stats = extract_stats_for(object: file, from: FileViewStat, start_date: start_date, user: user)
stats = tally_results(view_stats, :views, stats) if view_stats.present?
This resulted in attempting to call .each on the view_stats; which was true.
This builds on a [reported issue in Slack][1].
@samvera/hyrax-code-reviewers