-
Notifications
You must be signed in to change notification settings - Fork 446
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
Drive cache #296
base: master
Are you sure you want to change the base?
Drive cache #296
Conversation
Add cachetools to the requirements list. Drive-By: Remove upper version limit for click, keyring and keyring.alt. Fixes: picklepete#289 Fixes: picklepete#290
This is part one of a two part commit. This part removes the existing permanent cache for folder content and always fetch fresh data and return that. The second part will add a real TTL'd cache.
Allow for a TTL expiry cache in Drive. Cache is active by default, but can be changed on demand. Add debug logging.
Allow specific functions to invalidate the cache if needed. Makes sense after e.g. mkdir or an upload.
Hmm. Looks like cachetools does not exist for Python <3.5... There's also a complain about me accessing _cache from outside the DriveService object... That is true, but I kinda feel it's acceptable to use the service-wide cache from the DriveNode object... But it is still a drive-internal cache which is why I'm prefixing it with an underscore. |
Will remove support <3.6 or even <3.7 Coming to this PR just after this removal. |
Needs #303 |
Proposed change
Drive by default caches directory entries and will only invalidate them if a new directory is fetched.
This caching is happening in get_children().
Rework the cache to use a real TTL cache using the external cachetools.
Drive-By: Remove upper limits of dependency versions for click and keychain.
Fixes: #289
Fixes: #290
Type of change
Checklist
If user exposed functionality or configuration variables are added/changed: