diff --git a/app/jobs/stats_job.rb b/app/jobs/stats_job.rb new file mode 100644 index 000000000..14e530bc5 --- /dev/null +++ b/app/jobs/stats_job.rb @@ -0,0 +1,6 @@ +class StatsJob < ActiveJob::Base + queue_as :default + + def perform(*args) + end +end diff --git a/config/initializers/ahoy.rb b/config/initializers/ahoy.rb index 9a1215c68..095fe5ed0 100644 --- a/config/initializers/ahoy.rb +++ b/config/initializers/ahoy.rb @@ -1,9 +1,13 @@ class Ahoy::Store < Ahoy::Stores::ActiveRecordStore + def track_visit(options) + StatsJob.perform_later(super) + end + # Track user IP def track_event(name, properties, options) super do |event| event.ip = request.ip end end -end +end \ No newline at end of file