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

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

Issue 14856006: Docserver: achieve online vs offline (cron vs instance) behaviour at the object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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/cron_servlet.py
diff --git a/chrome/common/extensions/docs/server2/cron_servlet.py b/chrome/common/extensions/docs/server2/cron_servlet.py
index e768aa373132597a4186bd877003356d4260f064..d966272f53d92d229f3d29a8ad54163a7ccb375e 100644
--- a/chrome/common/extensions/docs/server2/cron_servlet.py
+++ b/chrome/common/extensions/docs/server2/cron_servlet.py
@@ -16,16 +16,16 @@ import svn_constants
class CronServlet(Servlet):
'''Servlet which runs a cron job.
'''
- def Get(self):
+ def Get(self, server_instance=None):
# Crons often time out, and when they do *and* then eventually try to
# flush logs they die. Turn off autoflush and manually do so at the end.
logservice.AUTOFLUSH_ENABLED = False
try:
- return self._GetImpl()
+ return self._GetImpl(server_instance)
finally:
logservice.flush()
- def _GetImpl(self):
+ def _GetImpl(self, server_instance):
# Cron strategy:
#
# Find all public template files and static files, and render them. Most of
@@ -35,7 +35,8 @@ class CronServlet(Servlet):
channel = self._request.path.strip('/')
logging.info('cron/%s: starting' % channel)
- server_instance = ServerInstance.CreateOnline(channel)
+ if server_instance is None:
+ server_instance = ServerInstance.CreateOnline(channel)
def run_cron_for_dir(d, path_prefix=''):
success = True

Powered by Google App Engine
This is Rietveld 408576698