add redis and sidekiq to clean up expired blacklisted jwt #171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses Issue #149
To test;
Uncomment Line 4 of cleanup_expired_jwt.rb and comment out Line 3. (This changes the timing of the background task to run every minute rather than every day. This is just for testing purposes. After test. Reverse this step).
Rebuild application given changes to gemfile and docker compose file;
This should show a list of all blacklisted tokens.
5. Navigate to localhost:4000. Login as any user and then logout (to create the blacklisted token).
6. In the rails console, run BlacklistedToken.all again. You should see 2 new instances that were created by logging out in step 4.
7. Wait ~ 1 minute then check the docker terminal. You should see something like this:
Note: have only tested this in localhost and dev environment. Will test in production next.