Delete inactive sessions after 90 days.

This commit is contained in:
Martin Edenhofer 2013-07-27 01:50:26 +02:00
parent dd27ad8566
commit ad9b4eee5d

View file

@ -169,7 +169,7 @@ class SessionsController < ApplicationController
end
def delete_old
ActiveRecord::SessionStore::Session.where('request_type = ? AND updated_at < ?', 1, Time.now - 150.days ).delete_all
ActiveRecord::SessionStore::Session.where('request_type = ? AND updated_at < ?', 1, Time.now - 90.days ).delete_all
ActiveRecord::SessionStore::Session.where('request_type = ? AND updated_at < ?', 2, Time.now - 2.days ).delete_all
render :json => {}
end