Commit 10e7c0fd authored by rockot's avatar rockot Committed by Commit bot

Docserver: Default to master commit ID on refresh

Currently _refresh handler caches data uses tip of tree
and caches data under the remote's master commit ID if
run without a 'commit' paramter.

This CL changes the handler to use the last cached 'master'
commit ID instead, so that refresh tasks for non-chromium-git
data can be run between refresh cycles.

BUG=None
R=kalman@chromium.org
NOTRY=True

Review URL: https://codereview.chromium.org/684113003

Cr-Commit-Position: refs/heads/master@{#302635}
parent f4fde32f
application: chrome-apps-doc
version: 3-47-1
version: 3-47-2
runtime: python27
api_version: 1
threadsafe: false
......
......@@ -2,4 +2,4 @@ cron:
- description: Repopulates all cached data.
url: /_cron
schedule: every 60 minutes
target: 3-47-1
target: 3-47-2
......@@ -90,6 +90,12 @@ class RefreshServlet(Servlet):
commit_tracker = CommitTracker(server_instance.object_store_creator)
refresh_tracker = RefreshTracker(server_instance.object_store_creator)
# If no commit was given, use the ID of the last cached master commit.
# This allows sources external to the chromium repository to be updated
# independently from individual refresh cycles.
if commit is None:
commit = commit_tracker.Get('master').Get()
success = True
try:
if source_name == 'platform_bundle':
......
......@@ -52,8 +52,8 @@ class RietveldPatcher(Patcher):
raise RietveldPatcherError('Cannot parse issue %s.' % self._issue)
if not issue_json.get('base_url') in _CHROMIUM_REPO_BASEURLS:
raise RietveldPatcherError('Issue %s\'s base url is unknown.' %
self._issue)
raise RietveldPatcherError('Issue %s\'s base url (%s) is unknown.' %
(self._issue, issue_json.get('base_url')))
return str(patchsets[-1])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment