I needed to figure out how to wipe the session table clean of all sessions older than a given number of hours.
num = num_hours * 3600
sql = ActiveRecord::Base.connection();
sql.begin_db_transaction
sql.execute("DELETE FROM sessions WHERE now() - updated_at > #{num}");
sql.commit_db_transaction
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment