From e10887377b8ad0f94804ae35beba3755f52e7976 Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Thu, 7 Jul 2016 14:18:51 +0200 Subject: [PATCH] Write new timestamp at the end in crawl.py If a timeout occurs during a crawl an old timestamp will be preserved. Change-Id: Ibae158baa1a8c8fbe09397225b312d29d44e715c Signed-off-by: Aleksander Mistewicz --- tsp/scripts/crawler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsp/scripts/crawler.py b/tsp/scripts/crawler.py index 640c084..4cc1669 100755 --- a/tsp/scripts/crawler.py +++ b/tsp/scripts/crawler.py @@ -68,8 +68,6 @@ def get_modified_paths(discovered, timestamp): else: return discovered logging.info("Previous timestamp: %s", stamp) - with open(timestamp, 'w') as f: - f.write(str_time) for url in discovered: logging.debug("Check for MD5SUMS change: %s", url) for md5sums_url in [url + 'images/arm-wayland/common-wayland-3parts-armv7l-odroidu3/MD5SUMS',\ @@ -83,6 +81,8 @@ def get_modified_paths(discovered, timestamp): logging.info("MD5SUMS changed: %s", url) ret.add(url) break + with open(timestamp, 'w') as f: + f.write(str_time) return ret def parse_arguments(): -- 2.7.4