summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorahernandez.miralles@gmail.com <ahernandez.miralles@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-24 00:11:14 +0000
committerahernandez.miralles@gmail.com <ahernandez.miralles@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-24 00:11:14 +0000
commitcd637d6f4083b8498425d56c77169efb83d474d2 (patch)
tree19a143475adde1a912eebc3359e5b72f56920af5
parent3bdfaaed7a6209afb88c7fa06993abfa07576544 (diff)
downloadchromium_src-cd637d6f4083b8498425d56c77169efb83d474d2.zip
chromium_src-cd637d6f4083b8498425d56c77169efb83d474d2.tar.gz
chromium_src-cd637d6f4083b8498425d56c77169efb83d474d2.tar.bz2
Stop rendering all files in cron
BUG=305280 NOTRY=true Review URL: https://codereview.chromium.org/213403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265783 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/docs/server2/app.yaml2
-rw-r--r--chrome/common/extensions/docs/server2/cron.yaml2
-rw-r--r--chrome/common/extensions/docs/server2/cron_servlet.py10
-rw-r--r--chrome/common/extensions/docs/server2/instance_servlet.py11
-rwxr-xr-xchrome/common/extensions/docs/server2/instance_servlet_test.py4
-rw-r--r--chrome/common/extensions/docs/server2/template_data_source.py2
6 files changed, 8 insertions, 23 deletions
diff --git a/chrome/common/extensions/docs/server2/app.yaml b/chrome/common/extensions/docs/server2/app.yaml
index 81862d9..0e642ed 100644
--- a/chrome/common/extensions/docs/server2/app.yaml
+++ b/chrome/common/extensions/docs/server2/app.yaml
@@ -1,5 +1,5 @@
application: chrome-apps-doc
-version: 3-19-0
+version: 3-20-0
runtime: python27
api_version: 1
threadsafe: false
diff --git a/chrome/common/extensions/docs/server2/cron.yaml b/chrome/common/extensions/docs/server2/cron.yaml
index 233c1b4..5285941 100644
--- a/chrome/common/extensions/docs/server2/cron.yaml
+++ b/chrome/common/extensions/docs/server2/cron.yaml
@@ -2,4 +2,4 @@ cron:
- description: Repopulates all cached data.
url: /_cron
schedule: every 5 minutes
- target: 3-19-0
+ target: 3-20-0
diff --git a/chrome/common/extensions/docs/server2/cron_servlet.py b/chrome/common/extensions/docs/server2/cron_servlet.py
index 4fcd5d1..622b0f1 100644
--- a/chrome/common/extensions/docs/server2/cron_servlet.py
+++ b/chrome/common/extensions/docs/server2/cron_servlet.py
@@ -200,16 +200,6 @@ class CronServlet(Servlet):
finally:
_cronlog.info('%s took %s' % (title, timer.Stop().FormatElapsed()))
- # Rendering the public templates will also pull in all of the private
- # templates.
- results.append(request_files_in_dir(PUBLIC_TEMPLATES,
- strip_ext=('.html', '.md')))
-
- # Rendering the public templates will have pulled in the .js and
- # manifest.json files (for listing examples on the API reference pages),
- # but there are still images, CSS, etc.
- results.append(request_files_in_dir(STATIC_DOCS, prefix='static'))
-
# Samples are too expensive to run on the dev server, where there is no
# parallel fetch.
#
diff --git a/chrome/common/extensions/docs/server2/instance_servlet.py b/chrome/common/extensions/docs/server2/instance_servlet.py
index a408049..a23bb43 100644
--- a/chrome/common/extensions/docs/server2/instance_servlet.py
+++ b/chrome/common/extensions/docs/server2/instance_servlet.py
@@ -4,7 +4,7 @@
from branch_utility import BranchUtility
from compiled_file_system import CompiledFileSystem
-from environment import IsDevServer
+from environment import IsDevServer, IsReleaseServer
from github_file_system_provider import GithubFileSystemProvider
from host_file_system_provider import HostFileSystemProvider
from third_party.json_schema_compiler.memoize import memoize
@@ -37,14 +37,11 @@ class InstanceServletRenderServletDelegate(RenderServlet.Delegate):
branch_utility = self._delegate.CreateBranchUtility(object_store_creator)
# In production have offline=True so that we can catch cron errors. In
# development it's annoying to have to run the cron job, so offline=False.
- #
- # XXX(kalman): The above comment is not true, I have temporarily disabled
- # this while the cron is running out of memory and not reliably finishing.
- # In the meantime, live dangerously and fetch content if it's not there.
- # I.e. never offline. See http://crbug.com/345361.
+ # Note that offline=True if running on any appengine server due to
+ # http://crbug.com/345361.
host_file_system_provider = self._delegate.CreateHostFileSystemProvider(
object_store_creator,
- offline=False) # XXX(kalman): condition should be "not IsDevServer()"
+ offline=not (IsDevServer() or IsReleaseServer()))
github_file_system_provider = self._delegate.CreateGithubFileSystemProvider(
object_store_creator)
return ServerInstance(object_store_creator,
diff --git a/chrome/common/extensions/docs/server2/instance_servlet_test.py b/chrome/common/extensions/docs/server2/instance_servlet_test.py
index 540f1dd..f857ed6 100755
--- a/chrome/common/extensions/docs/server2/instance_servlet_test.py
+++ b/chrome/common/extensions/docs/server2/instance_servlet_test.py
@@ -30,10 +30,8 @@ class InstanceServletTest(unittest.TestCase):
It should never return a 500 (i.e. crash).
'''
- # XXX(kalman): Disabled, see comment in instance_servlet.py and
- # http://crbug.com/345361.
@DisableLogging('warning')
- def DISABLED_testHostFileSystemNotAccessed(self):
+ def testHostFileSystemNotAccessed(self):
delegate = _TestDelegate(FailOnAccessFileSystem)
constructor = InstanceServlet.GetConstructor(delegate_for_test=delegate)
def test_path(path, status=404):
diff --git a/chrome/common/extensions/docs/server2/template_data_source.py b/chrome/common/extensions/docs/server2/template_data_source.py
index 4f8395b..b106453 100644
--- a/chrome/common/extensions/docs/server2/template_data_source.py
+++ b/chrome/common/extensions/docs/server2/template_data_source.py
@@ -38,7 +38,7 @@ class TemplateDataSource(DataSource):
futures = []
for root, _, files in self._file_system.Walk(self._dir):
futures += [self._template_cache.GetFromFile(
- posixpath.join(self._dir, root, f))
+ posixpath.join(self._dir, root, FormatKey(f)))
for f in files
if posixpath.splitext(f)[1] == '.html']
return Collect(futures)