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.9.6 lib/tasks/sessions.rake
disco_app-0.9.7 lib/tasks/sessions.rake
disco_app-0.9.8 lib/tasks/sessions.rake
disco_app-0.9.9 lib/tasks/sessions.rake
disco_app-0.9.10 lib/tasks/sessions.rake
disco_app-0.9.11 lib/tasks/sessions.rake
disco_app-0.10.0 lib/tasks/sessions.rake
disco_app-0.10.1 lib/tasks/sessions.rake
disco_app-0.10.2 lib/tasks/sessions.rake
disco_app-0.10.3 lib/tasks/sessions.rake
disco_app-0.10.4 lib/tasks/sessions.rake
disco_app-0.10.5 lib/tasks/sessions.rake
disco_app-0.11.0 lib/tasks/sessions.rake
disco_app-0.11.1 lib/tasks/sessions.rake
disco_app-0.12.0 lib/tasks/sessions.rake
disco_app-0.12.1 lib/tasks/sessions.rake
disco_app-0.12.5 lib/tasks/sessions.rake
disco_app-0.12.6 lib/tasks/sessions.rake
disco_app-0.12.7 lib/tasks/sessions.rake
disco_app-0.13.0 lib/tasks/sessions.rake