Sha256: 07d8363c832b6b55d68d2b621f8bf1c30e9f2d751d7e6e29a7dcefbaa03f3cef

Contents?: true

Size: 340 Bytes

Versions: 59

Compression:

Stored size: 340 Bytes

Contents

namespace :sessions do

  desc 'Clean out any stale sessions.'
  task clean: [:environment, 'db:load_config'] do
    threshold = (ENV['SESSIONS_CLEAN_THRESHOLD_DAYS'] || 30).to_i.days.ago
    ActiveRecord::Base.connection.execute("DELETE FROM #{ActiveRecord::SessionStore::Session.table_name} WHERE updated_at < '#{threshold}'")
  end

end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
disco_app-0.16.1.pre.sidekiq.pre.6.pre.release lib/tasks/sessions.rake
disco_app-0.7.0 lib/tasks/sessions.rake
disco_app-0.7.1 lib/tasks/sessions.rake
disco_app-0.7.2 lib/tasks/sessions.rake
disco_app-0.8.0 lib/tasks/sessions.rake
disco_app-0.8.1 lib/tasks/sessions.rake
disco_app-0.8.2 lib/tasks/sessions.rake
disco_app-0.8.3 lib/tasks/sessions.rake
disco_app-0.8.4 lib/tasks/sessions.rake
disco_app-0.8.5 lib/tasks/sessions.rake
disco_app-0.8.6 lib/tasks/sessions.rake
disco_app-0.8.7 lib/tasks/sessions.rake
disco_app-0.8.8 lib/tasks/sessions.rake
disco_app-0.8.9 lib/tasks/sessions.rake
disco_app-0.9.0 lib/tasks/sessions.rake
disco_app-0.9.1 lib/tasks/sessions.rake
disco_app-0.9.2 lib/tasks/sessions.rake
disco_app-0.9.3 lib/tasks/sessions.rake
disco_app-0.9.4 lib/tasks/sessions.rake
disco_app-0.9.5 lib/tasks/sessions.rake