Comments (5)
Interesting approach. I was thinking about purging the other day. My initial thoughts were to setup a supervisor that runs on a timer and just periodically cleans it outside of all requests. Thoughts?
from guardian_db.
@hassox it sounds like a better solution but I think it would be an overhead for such a simple task. It is worth nothing to add these 3 lines and update documentation with this config key description, unlike creating a GC server. You can always add GC worker later but for now this probability-based GC will work just fine for most of users I believe.
from guardian_db.
I've just added a worker that you can optionally add to your supervision tree @chvanikoff. #20 Love some feedback.
from guardian_db.
@hassox Generally, it's ok. But here is what I'd change:
- Move
interval
to config and have some reasonable default value (30m for example) - Use minutes rather than milliseconds. I doubt anyone would want to run the cleanup 10 times per second or even more than 1 time per minute.
from guardian_db.
Good feedback. I've pushed up a v0.7.0 with these features :D
from guardian_db.
Related Issues (20)
- separated token schemes HOT 4
- hash of tokens HOT 2
- Revoking Token thats already been removed throws error rather than returning error HOT 1
- Dependency Update
- Changelog updates since 0.8 HOT 3
- How to add more columns to 'guardian_tokens' table? HOT 5
- Compatibility with Guardian 2.0 HOT 2
- Idea: Use gen server to avoid round-trip to database HOT 9
- Update ecto_sql(currently at 3.1.0) dependency to the latest version HOT 1
- Do not fix ecto version HOT 2
- Documentation: need to update migrations if using non-default table name
- Guardian DB Redis Repo HOT 11
- Ecto.StaleEntryError when using Guardian.DB.on_revoke HOT 8
- cut a new release? HOT 1
- Add a column to optionally store the jti of the refresh token used to generate an access token. HOT 2
- Publish new release HOT 1
- `Guardian.DB.Sweeper` incompatible with old worker API HOT 1
- function Guardian.DB.on_refresh/2 is undefined or private HOT 3
- guardian_db fails to compile with Ecto 3 rc (undefined function migrations_path/1) HOT 20
- how to use in two or more servers with login just one time? share pwd HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guardian_db.