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