Измеряйте загрузку до подтверждения приёма вложения
This commit is contained in:
@@ -140,10 +140,7 @@ def experiment(args, content, report):
|
||||
report['download'] = {'ok': False}
|
||||
if accepted:
|
||||
try:
|
||||
response = bootstrap.call('GET', '/api/v1/attachments/' + accepted[0]['attachment_id'] + '/content', actor=reader)
|
||||
body = response['bytes']
|
||||
report['download'] = {'ok': body == content and response['headers'].get_content_type() == args.mime,
|
||||
'status': response['status'], 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest()}
|
||||
report['download'] = memory.verify_download(bootstrap, reader, accepted[0]['attachment_id'], content, args.mime)
|
||||
except Exception as exc:
|
||||
report['download']['error'] = str(exc) if isinstance(exc, module.Failure) else type(exc).__name__
|
||||
report['ok'] = (len(accepted) == args.concurrency and report['download']['ok'] and stable
|
||||
|
||||
Reference in New Issue
Block a user