-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add redis and associated env variables * Cache events for up to 15 minutes: * Add BaseConnector with some helper functions to get/put cached events into redis. * Move some password hashing/string encryption funcs to a utils.py file. * Add redis_instance as a constructor variable. * Add subscriber_id as a constructor variable for CalDavConnector. * Add model_(load/dump)_redis helper function to Event schema. * Add test for model_(load/dump)_redis helper functions. * Add redis key define. * Add redis dependency injection function. * Require calendar_id (pk) and subscriber_id (pk) for each calendar connector * Cache key to allow for busting all or a specific calendar from a specific user * Bust event cache when a calendar is synced or an event is created or removed. * Lots of wiring up new parameters / mock parameters for tests * Add caching to the booking page: * Use the same event cache for the booking page. * Verify that a user can book a given time slot against remote calendar events. * Add tests to request availability. * Rename REDIS_REMOVE_EVENTS_KEY to REDIS_REMOTE_EVENTS_KEY * Rename get_cache_events to get_cached_events * Cache result of setup_encryption_engine
- Loading branch information
1 parent
e4a596d
commit d5649da
Showing
19 changed files
with
549 additions
and
125 deletions.
There are no files selected for viewing
This file contains 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,3 +88,13 @@ GOOGLE_TEST_USER= | |
GOOGLE_TEST_PASS= | ||
|
||
TEST_USER_EMAIL=[email protected] | ||
|
||
# -- Redis -- | ||
REDIS_URL=localhost | ||
REDIS_PORT=6379 | ||
REDIS_DB=0 | ||
# No value = Python None | ||
REDIS_PASSWORD | ||
|
||
# In minutes, the time a cached remote event will expire at. | ||
REDIS_EVENT_EXPIRE_TIME=15 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ uvicorn==0.20.0 | |
validators==0.20.0 | ||
oauthlib==3.2.2 | ||
requests-oauthlib==1.3.1 | ||
redis==5.0.2 | ||
hiredis==2.3.2 |
This file contains 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 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.