# app/jobs/core/zone_access_log_job.rb
class Core::ZoneAccessLogJob < ApplicationJob
queue_as :default
def perform(visited_at, key, access_from, access_type, identifier, data: {})
# Fake job class for ActiveJob/Sidekiq job creation
end
end
# app/jobs/core/zone_access_log_job.rb
class Core::ZoneAccessLogJob < ApplicationJob
queue_as :default
def perform(visited_at, key, access_from, access_type, identifier, data: {})
zone = Core::Zone.joins(project: [:space]).includes(project: [:space]).find_by(code: key)
project = zone.project
space = zone.project.space
# Create new log access to extended log.
log = ZoneAccess::ExtendedLog.new
# When zone is accessed.
log.visited_at = visited_at
# Accessed zone code.
log.zone_code = key
# Access from api, page_provider.
log.access_from = access_from
# Access type 404, api, page, redirect, poi...
log.access_type = access_type
# Project, space and zone associations.
log.project = project
log.space = space
log.zone = zone
# Who access to zone.
log.identifier = identifier
log.identifier_data = data
# Save data to database.
log.save!
end
end
--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+unsubscribe@googlegroups.com.
To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/836db79d-221e-480f-96e4-a474a0d53a16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+u...@googlegroups.com.
To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/836db79d-221e-480f-96e4-a474a0d53a16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.