Skip to content

Commit

Permalink
Merge pull request #1794 from uclibs/bug/#1767-ga-import-2
Browse files Browse the repository at this point in the history
Handle google analytics error
  • Loading branch information
crowesn authored Feb 16, 2018
2 parents 78fceaa + dd2f780 commit df9e570
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ AllCops:
- 'app/services/report.rb'
- 'app/services/work_loader.rb'
- 'app/services/hyrax/actor_factory.rb'
- 'app/services/hyrax/user_stat_importer.rb'
- 'spec/services/hyrax/actor_factory_spec.rb'
- 'db/**/*'
- 'lib/tasks/batch.rake'
Expand Down
9 changes: 9 additions & 0 deletions app/services/hyrax/user_stat_importer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true
require Hyrax::Engine.root.join('app/services/hyrax/user_stat_importer.rb')
module Hyrax
class UserStatImporter
require 'legato'
require 'hyrax/pageview'
require 'hyrax/download'
end
end
10 changes: 10 additions & 0 deletions lib/tasks/stats_tasks.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true
namespace :hyrax do
namespace :stats do
desc "Cache work view, file view & file download stats for all users"
task user_stats: :environment do
importer = Hyrax::UserStatImporter.new(verbose: true, logging: true, delay_secs: 1)
importer.import
end
end
end

0 comments on commit df9e570

Please sign in to comment.