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 |