Prepared for request_type replacement.

This commit is contained in:
Martin Edenhofer 2015-06-23 14:17:04 +02:00
parent bea2a732e8
commit 5840225332

View file

@ -28,11 +28,12 @@ module SessionHelper
def self.cleanup_expired def self.cleanup_expired
# web sessions # delete temp. sessions
ActiveRecord::SessionStore::Session.where('request_type = ? AND updated_at < ?', 1, Time.zone.now - 90.days ).delete_all ActiveRecord::SessionStore::Session.where('request_type IS NULL AND updated_at < ?', Time.zone.now - 1.days ).delete_all
# web sessions older the x days
ActiveRecord::SessionStore::Session.where('updated_at < ?', Time.zone.now - 90.days ).delete_all
# http basic auth calls
ActiveRecord::SessionStore::Session.where('request_type = ? AND updated_at < ?', 2, Time.zone.now - 2.days ).delete_all
end end
def self.get(id) def self.get(id)