Class: SessionsSweepJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
lib/generators/sessions/templates/sessions_sweep_job.rb

Overview

The sessions maintenance pass — schedule it daily (see config/recurring.yml below if you’re on Solid Queue). It purges trail rows past ‘config.events_retention`, evicts per-user overflow beyond `config.max_sessions_per_user`, and (only if you opted into timeouts) expires idle/over-age sessions.

# config/recurring.yml
production:
  sessions_sweep:
    class: SessionsSweepJob
    schedule: every day at 4am

Instance Method Summary collapse

Instance Method Details

#performObject



17
18
19
# File 'lib/generators/sessions/templates/sessions_sweep_job.rb', line 17

def perform
  Sessions.sweep!
end