-
-
Notifications
You must be signed in to change notification settings - Fork 751
RedisCache - Data Persistence #947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
3aeb9e6
Adding redis to docker-compose file.
5382dd8
Adding redis-py to the Pipfile
7a501fd
Boilerplate for the RedisCacheMixin
588521c
Refactor - no more mixins!
ee8386e
Add basic dict methods for RedisDict.
5859711
copy should dictify the .items(), not just keys.
9eeee1c
Implements .clear with hash deletion.
677a7f7
Implement .get, equality, and membership check
0843728
Add fakeredis to the Pipfile
7cf0e83
Implement .pop, .popitem and .setdefault.
bf6c113
Test suite for the redis dict.
258ad9d
Make redis host and port configurable.
8456023
namespace "general" -> "global"
f19c38c
Merge branch 'master' into redis_persistence
lemonsaurus e993566
Fix linting errors introduced by flake8 3.8
79f62db
Merge branch 'master' into redis_persistence
lemonsaurus adf50a6
Changes discord-py to discord.py in Pipfile
ecf7f24
Add the REDIS_PASSWORD environment variable
cc3591d
Add the REDIS_PASSWORD environment variable
23c2e7a
Replace redis-py with aioredis.
3f596d5
Opens a Redis connection in the Bot class.
57fe4bf
Set up async testbed
fd6f3d3
Fix assertion for `create_task` in duck pond tests
MarkKoz 45e6f8d
Improve aiohttp context manager mocking in snekbox tests
MarkKoz 6aed2f6
Fix unawaited coro warning when instantiating Bot for MockBot's spec
MarkKoz 1ad7833
Properly mock the redis pool in MockBot
MarkKoz d8f1634
Use autospecced mocks in MockBot for the stats and aiohttp session
MarkKoz eb63fb0
Finish .set and .get, and add tests.
c8a9a77
Finish asyncifying RedisCache methods
387bf5c
Complete asyncified test suite for RedisCache
5bd8e13
Better docstring for RedisCache
db75440
Better docstring for RedisCache.contains
87c7679
Merge branch 'master' into redis_persistence
lemonsaurus 54bb228
Merge branch 'redis_persistence' of github.com:python-discord/bot int…
fc1999e
Unbreak the error_handler
49492ff
Moving the Redis session creation to Bot._recreate
489f940
CI needs REDIS_PASSWORD to pass tests
1ea4718
Update exception message
lemonsaurus aa0bb02
Fix typo in test_to_dict docstring
2fb8625
Don't rely on HDEL ignoring keys for .pop
5120717
DRY approach to typestring prefix resolution
a52a130
Remove redis session mock from MockBot
MarkKoz 923d03a
Show a warning when redis pool isn't closed
MarkKoz 96a3ac7
Merge branch 'master' into redis_persistence
lemonsaurus 3f8dce7
use __name__ for type list
lemonsaurus ed12a2f
len(prefix) instead of hardcoding 2
lemonsaurus 98d8bb3
Refactor the nice prefix/type strings to constants
1d05a4d
Improves various docstrings and comments.
f05fefb
Better RuntimeErrors.
b2009d5
Make .items return ItemsView instead of AsyncIter
01bedca
Add .increment and .decrement methods.
f80ce10
Rename Bot._redis_ready to Bot.redis_ready
361b740
Add logging to the RedisCache.
c5e6e8f
MockBot needs to be aware of redis_ready
66d273f
Add an option to use fakeredis in Bot.
ad8b1fa
Improve error and error testing for increment
856cecb
Add support for Union type annotations for constants
MarkKoz 9b9aa9b
Support validating collection types for constants
MarkKoz 87d42ad
Improve output of section name in config validation subtests
MarkKoz 8b5c1aa
Expose the redis port to the host
MarkKoz 9b882c7
Turn log.exception into log.error
723c1d3
Fix edge case where pop might not delete.
b630ace
Add better docstring for RedisCache.update
1920673
Make self.increment_lock private.
46a377d
Improve some docstrings for RedisCache.
ec8205c
Swap the order for the validate_cache checks.
1ab34dd
Add a test for RuntimeErrors.
38fcc10
Merge branch 'master' into redis_persistence
lemonsaurus 35a1de3
Clear cache in asyncSetUp instead of tests.
b189307
Refactor .increment and add lock test.
4db313e
Floats are no longer permitted as RedisCache keys.
b6093bf
Refactor typestring converters to partialmethods.
63b81b0
Fix ATROCIOUS comment.
44c3091
Merge branch 'master' into redis_persistence
lemonsaurus bdb7bbc
Reduce complexity on some of the typestring stuff.
11542fb
Make prefix consts private and more precise.
f66a635
Add custom exceptions for each error state.
b7c30d4
Prevent a state where a coro could wait forever.
cc45960
Move the `self.redis_closed` into session create.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.