dimanche 28 septembre 2014

What is the best practice to remove stale records from user_sessions?


Vote count:

0




I have an authlogic rails3 application using the user_sessions table in lieu of cookies. The table keeps growing and I can not do a find_by_sql delete from user_session where created_at <= (-15 days) [NOT the sql I am trying to use] for either a user_sessions action nor from another action. In the other action controller I can do a MYcontroller.find_by_sql("select count(*) from user_sessions") but a MYcontroller.find_by_sql("delete from user_sessions where xxx <= yyy") does not work (xxx and yyy are date type items). Using the delete clause directly in the rails db console does delete the expected records.


What should I be doing to control growth in this table?



asked 1 min ago







What is the best practice to remove stale records from user_sessions?

Aucun commentaire:

Enregistrer un commentaire