Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: chrome/common/extensions/docs/server2/handler.py

Issue 10831269: Extensions Docs Server: BranchUtility not fetching branch numbers correctly (fixed) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/handler.py
diff --git a/chrome/common/extensions/docs/server2/handler.py b/chrome/common/extensions/docs/server2/handler.py
index 4f4f9de7e68122109841c36d7d2bf25b61913b0f..e306ea7a61193003b9433ce252dffccf06a2c9b2 100644
--- a/chrome/common/extensions/docs/server2/handler.py
+++ b/chrome/common/extensions/docs/server2/handler.py
@@ -39,7 +39,7 @@ OMAHA_PROXY_URL = 'http://omahaproxy.appspot.com/json'
BRANCH_UTILITY_MEMCACHE = AppEngineMemcache('branch_utility')
BRANCH_UTILITY = BranchUtility(OMAHA_PROXY_URL,
DEFAULT_BRANCH,
- AppEngineUrlFetcher(''),
+ AppEngineUrlFetcher(None),
BRANCH_UTILITY_MEMCACHE)
STATIC_DIR_PREFIX = 'docs/server2'
@@ -105,6 +105,13 @@ def _GetURLFromBranch(branch):
return TRUNK_URL + '/src'
return BRANCH_URL + '/' + branch + '/src'
+def _CleanBranches():
+ numbers = [BRANCH_UTILITY.GetBranchNumberForChannelName(branch)
+ for branch in ['dev', 'beta', 'stable', 'trunk', 'local']]
not at google - send to devlin 2012/08/13 00:53:00 currently only the branch utility knows what the a
cduvall 2012/08/13 21:45:04 Done.
+ for key in SERVER_INSTANCES.keys():
+ if key not in numbers:
+ SERVER_INSTANCES.pop(key)
+
class Handler(webapp.RequestHandler):
def __init__(self, request, response, local_path=EXTENSIONS_PATH):
self._local_path = local_path
@@ -118,8 +125,9 @@ class Handler(webapp.RequestHandler):
real_path = 'apps/index.html'
if real_path.strip('/') == 'extensions':
real_path = 'extensions/index.html'
- # TODO: This leaks Server instances when branch bumps.
+ _CleanBranches()
_GetInstanceForBranch(branch, self._local_path).Get(real_path,
+ channel_name,
not at google - send to devlin 2012/08/13 00:53:00 why can't this go in the constructor of template_d
cduvall 2012/08/13 21:45:04 Done.
self.request,
self.response)

Powered by Google App Engine
This is Rietveld 408576698