[devserver] GetStatusOfBackgroundDownloads() should update timestamp.
Background downloaders get thrown into a cache, and on the second time a
build is requested, we hit the cache and directly grab the status rather
than asking if the build exists. This means that we bypass the update
the timestamp step, so if the second request is about 24 hours after the
first request, we might wipe the build while it's being used.
BUG=chromium-os:33559
TEST=pylint
Change-Id: Ic73a9ca0fbfd66c8ee79b8848dd019c0fca5d7d9
Reviewed-on: https://gerrit.chromium.org/gerrit/30479
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Alex Miller <milleral@chromium.org>
diff --git a/downloader.py b/downloader.py
index 682a874..17dadba 100755
--- a/downloader.py
+++ b/downloader.py
@@ -200,6 +200,10 @@
status = self._status_queue.get()
# In case anyone else is calling.
self._status_queue.put(status)
+ # If someone is curious about the status of a build, then we should
+ # probably keep it around for a bit longer.
+ if os.path.exists(self._staging_dir):
+ Downloader._TouchTimestampForStaged(self._staging_dir)
# It's possible we received an exception, if so, re-raise it here.
if isinstance(status, Exception):
raise status