Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ninech/activerecord_session_cleaner
Gem to remove old sessions from your ActiveRecord DB with a cron job
https://github.com/ninech/activerecord_session_cleaner
Last synced: about 1 month ago
JSON representation
Gem to remove old sessions from your ActiveRecord DB with a cron job
- Host: GitHub
- URL: https://github.com/ninech/activerecord_session_cleaner
- Owner: ninech
- License: mit
- Created: 2014-03-14T14:13:44.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-10-24T07:37:41.000Z (about 7 years ago)
- Last Synced: 2024-09-18T02:58:51.310Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 20
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# activerecord_session_cleaner [![Gem Version](https://badge.fury.io/rb/activerecord_session_cleaner.png)](http://badge.fury.io/rb/activerecord_session_cleaner) [![Build Status](https://travis-ci.org/ninech/activerecord_session_cleaner.svg)](https://travis-ci.org/ninech/activerecord_session_cleaner)
Gem to remove old sessions from your ActiveRecord DB.
## Installation
In your Gemfile, add:
``` ruby
gem 'activerecord_session_cleaner'
```## Features
* Delete all sessions
* Delete sessions not updated in the last `$x` days
* Setup cleanup cron to delete old sessions## Tasks
# Delete old sessions from an Active Record session store
rake activerecord_session_cleaner:cleanup:old[days_to_keep]
# Delete all session from an Active Record session store
rake activerecord_session_cleaner:cleanup:all# Setup/update cron for session cleanup
rake activerecord_session_cleaner:crontab:update[application_name,days_to_keep]
# Remove cleanup cron for session cleanup
rake activerecord_session_cleaner:crontab:clear[application_name]Default values:
* `days_to_keep`: `10`
* `application_name`: basename of the current working directory (`example` if you are in `/home/gooby/example`)## License
activerecord_session_cleaner is released under the MIT License. See [LICENSE.txt](LICENSE.txt) for further details.