Prepared for request_type replacement.
This commit is contained in:
parent
bea2a732e8
commit
5840225332
1 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue