Allow the HTTP cache to be disabled or created in any location
Review Request #7293 — Created May 8, 2015 and submitted
The HTTP cache for the API can now be disabled via the
--disable-caching
command line argument. It can also be moved to an
arbitrary location with--cache-location FILE
or created in memory
with--in-memory-cache
. This behaviour is also available to consumers
of the API via theRBClient
. Theallow_caching
,cache_location
,
andin_memory_cache
key word arguments can be used for this.
Unit tests passed.
Ran the following commands:
rbt status --debug --disable-cache
rbt status --debug --in-memory-cache
rbt status --debug --cache-location /tmp/cache
The debugging information indicated the correct behaviour was taking
place in each instance.
Description | From | Last Updated |
---|---|---|
Col: 1 W391 blank line at end of file |
reviewbot | |
Because of the magic of kwargs, you can just do: self._cache = APICache(create_db_in_memory=in_memory, db_location=cache_location) |
david | |
Blank line between these. |
chipx86 | |
This can be: self.cache_path = db_location or self.DEFAULT_CACHE_PATH |
chipx86 | |
We should probably add config options for these as well. |
chipx86 | |
Missing a trailing period. |
chipx86 | |
It's going to delete whichever one is specified, right? |
chipx86 |
-
Tool: Pyflakes Processed Files: rbtools/api/transport/__init__.py rbtools/commands/__init__.py rbtools/commands/clearcache.py rbtools/api/transport/sync.py rbtools/api/cache.py rbtools/api/request.py Tool: PEP8 Style Checker Processed Files: rbtools/api/transport/__init__.py rbtools/commands/__init__.py rbtools/commands/clearcache.py rbtools/api/transport/sync.py rbtools/api/cache.py rbtools/api/request.py
-
Tool: Pyflakes Processed Files: rbtools/api/transport/__init__.py rbtools/commands/__init__.py rbtools/commands/clearcache.py rbtools/api/transport/sync.py rbtools/api/cache.py rbtools/api/request.py Tool: PEP8 Style Checker Processed Files: rbtools/api/transport/__init__.py rbtools/commands/__init__.py rbtools/commands/clearcache.py rbtools/api/transport/sync.py rbtools/api/cache.py rbtools/api/request.py
- Change Summary:
-
Address Christian's issues.
- Commit:
-
1594a8f787880fbf97f04a3e853bebc9dee3d37f99cf0ff0b1b958979ebb1d2108d2ef3a6f501f97
-
Tool: Pyflakes Processed Files: rbtools/api/transport/__init__.py rbtools/commands/__init__.py rbtools/commands/clearcache.py rbtools/api/transport/sync.py rbtools/api/cache.py rbtools/api/request.py Tool: PEP8 Style Checker Processed Files: rbtools/api/transport/__init__.py rbtools/commands/__init__.py rbtools/commands/clearcache.py rbtools/api/transport/sync.py rbtools/api/cache.py rbtools/api/request.py