Skip to content
Snippets Groups Projects
Commit 378410f1 authored by ale's avatar ale
Browse files

log file name and sha1 to debug checksum mismatches

parent 17cb61d4
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,7 @@ class Uploader(object):
def upload(self, path):
sha1 = utils.sha1_of_file(path)
log.info('new file: %s (%s)' % (path, sha1))
result = self._get('/check/' + sha1)
if result:
log.info('%s already on server (%s)' % (path, sha1))
......@@ -83,7 +84,6 @@ class Uploader(object):
break
if self.db.has(path):
continue
log.info('new file: %s' % path)
stats.data.set('uploading', path)
try:
self.upload(path)
......
......@@ -14,7 +14,7 @@ def generate_path(base_dir, sha1):
def sha1_of_file(path):
with open(path, 'r') as fd:
with open(path, 'rb') as fd:
sha = hashlib.sha1()
while True:
chunk = fd.read(4096)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment