moves storing of visits to queue
This commit is contained in:
6
app/jobs/stats_job.rb
Normal file
6
app/jobs/stats_job.rb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
class StatsJob < ActiveJob::Base
|
||||||
|
queue_as :default
|
||||||
|
|
||||||
|
def perform(*args)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
class Ahoy::Store < Ahoy::Stores::ActiveRecordStore
|
class Ahoy::Store < Ahoy::Stores::ActiveRecordStore
|
||||||
|
|
||||||
|
def track_visit(options)
|
||||||
|
StatsJob.perform_later(super)
|
||||||
|
end
|
||||||
|
|
||||||
# Track user IP
|
# Track user IP
|
||||||
def track_event(name, properties, options)
|
def track_event(name, properties, options)
|
||||||
super do |event|
|
super do |event|
|
||||||
|
|||||||
Reference in New Issue
Block a user