Fix constant recalculation of integration configurations.

Review Request #8780 — Created Feb. 25, 2017 and submitted

Information

Djblets
release-0.10.x
3166a1e...

Reviewers

We have code that attempts to check if the local configurations state is
stale, due to new integrations being registered or another
thread/process changing configuration. We have a flag that determines
whether we need to perform a recalculation due to local configuration
changes, which we happily set to True when registering an integration
but fail to ever set back to False, meaning that once expired, always
expired. This leads to a recalculation happening per-request, which is
not at all efficient. Unfortunately, unit tests failed to check for
this.

We now simply clear the flag after recalculating, as intended. Unit
tests have been updated to check that the resulting state is correct.

Unit tests pass.

No longer saw a SQL query for configurations for every HTTP request.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/integrations/manager.py
        djblets/integrations/tests/test_manager.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/integrations/manager.py
        djblets/integrations/tests/test_manager.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (d56d48e)
Loading...