Allow the HTTP cache to be disabled or created in any location

Review Request #7293 — Created May 8, 2015 and submitted

Information

RBTools
release-0.7.x
99cf0ff...

Reviewers

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 the RBClient. The allow_caching, cache_location,
and in_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

reviewbotreviewbot

Because of the magic of kwargs, you can just do: self._cache = APICache(create_db_in_memory=in_memory, db_location=cache_location)

daviddavid

Blank line between these.

chipx86chipx86

This can be: self.cache_path = db_location or self.DEFAULT_CACHE_PATH

chipx86chipx86

We should probably add config options for these as well.

chipx86chipx86

Missing a trailing period.

chipx86chipx86

It's going to delete whichever one is specified, right?

chipx86chipx86
reviewbot
  1. 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
    
    
  2. rbtools/api/transport/__init__.py (Diff revision 1)
     
     
    Show all issues
    Col: 1
     W391 blank line at end of file
    
  3. 
      
brennie
reviewbot
  1. 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
    
    
  2. 
      
david
  1. 
      
  2. rbtools/api/request.py (Diff revision 2)
     
     
     
     
     
    Show all issues

    Because of the magic of kwargs, you can just do:

    self._cache = APICache(create_db_in_memory=in_memory,
                           db_location=cache_location)
    
  3. 
      
brennie
reviewbot
  1. 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
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/api/cache.py (Diff revision 3)
     
     
     
    Show all issues

    Blank line between these.

  3. rbtools/api/cache.py (Diff revision 3)
     
     
     
     
     
    Show all issues

    This can be:

    self.cache_path = db_location or self.DEFAULT_CACHE_PATH
    
  4. rbtools/commands/__init__.py (Diff revision 3)
     
     
     
     
     
     
     
     
     
    Show all issues

    We should probably add config options for these as well.

  5. rbtools/commands/__init__.py (Diff revision 3)
     
     
    Show all issues

    Missing a trailing period.

  6. rbtools/commands/clearcache.py (Diff revision 3)
     
     
    Show all issues

    It's going to delete whichever one is specified, right?

  7. 
      
brennie
reviewbot
  1. 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
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.7.x (8e44525)
Loading...