From ccb7f3c684a4717de38a73baf7bbd838491d943c Mon Sep 17 00:00:00 2001 From: Christopher Usher Date: Tue, 8 Oct 2019 02:03:13 +0100 Subject: [PATCH] now use parse_segment_path to get hash from filename --- backfiller/backfiller/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backfiller/backfiller/main.py b/backfiller/backfiller/main.py index e50d95f..77d6954 100644 --- a/backfiller/backfiller/main.py +++ b/backfiller/backfiller/main.py @@ -10,6 +10,7 @@ import signal import socket import urlparse import uuid +from base64 import b64encode import argh import gevent.backdoor @@ -125,7 +126,8 @@ def get_remote_segment(base_dir, node, channel, quality, hour, missing_segment, f.write(chunk) hash.update(chunk) - if hash != common.parse_segment_path(missing_segment).hash: + filename_hash = common.parse_segment_path(missing_segment).hash + if filename_hash != hash.digest(): logger.warn('Hash of segment {} does not match. Discarding segment'.format(missing_segment)) hash_mismatches.labels(remote=node, channel=channel, quality=quality, hour=hour).inc() os.remove(temp_path)