Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensuring Hyrax::UserStatImporter returns false on exception #5874

Merged

Commits on Sep 20, 2022

  1. Ensuring Hyrax::UserStatImporter returns false on exception

    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.
    
    ```ruby
    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].
    
    Closes #5873
    
    [1]:https://samvera.slack.com/archives/C0F9JQJDQ/p1663608069939129
    jeremyf committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    c91e0dd View commit details
    Browse the repository at this point in the history