Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: globals/get_subscriptions.py

Issue 29337941: Issue 3750 - Avoid re-generating subscription list for each locale (Closed)
Patch Set: Turned get_subscriptions into a global function Created March 9, 2016, 3:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « filters/get_subscriptions.py ('k') | pages/subscriptions.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: globals/get_subscriptions.py
diff --git a/filters/get_subscriptions.py b/globals/get_subscriptions.py
similarity index 91%
rename from filters/get_subscriptions.py
rename to globals/get_subscriptions.py
index d5d20768584f4788fab1b1cc46ae68afb35a90b7..17c2c2398e0914bcc17133ea3ce231a7c581a87e 100644
--- a/filters/get_subscriptions.py
+++ b/globals/get_subscriptions.py
@@ -20,7 +20,12 @@ import urllib
import logging
from ConfigParser import SafeConfigParser
-def get_subscriptions(_):
+subscriptions = None
+
+def get_subscriptions():
+ global subscriptions
+ if not subscriptions is None:
+ return subscriptions
try:
from sitescripts.subscriptions import subscriptionParser
except ImportError:
@@ -57,4 +62,5 @@ def get_subscriptions(_):
subscriptionParser.get_settings = orig_get_settings
subscriptionParser.calculate_supplemented(result)
- return result.values()
+ subscriptions = result.values()
+ return subscriptions
« no previous file with comments | « filters/get_subscriptions.py ('k') | pages/subscriptions.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld