added size and duration to connection error reporting

This commit is contained in:
Danny Coates 2019-08-08 09:52:22 -07:00
parent 0729064753
commit 96c750c098
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
5 changed files with 28 additions and 19 deletions

View file

@ -44,7 +44,6 @@ export default class FileSender extends Nanobus {
}
async upload(archive, bearerToken) {
const start = Date.now();
if (this.cancelled) {
throw new Error(0);
}
@ -76,7 +75,6 @@ export default class FileSender extends Nanobus {
this.emit('progress'); // HACK to kick MS Edge
try {
const result = await this.uploadRequest.result;
const time = Date.now() - start;
this.msg = 'notifyUploadEncryptDone';
this.uploadRequest = null;
this.progress = [1, 1];
@ -87,8 +85,8 @@ export default class FileSender extends Nanobus {
name: archive.name,
size: archive.size,
manifest: archive.manifest,
time: time,
speed: archive.size / (time / 1000),
time: result.duration,
speed: archive.size / (result.duration / 1000),
createdAt: Date.now(),
expiresAt: Date.now() + archive.timeLimit * 1000,
secretKey: secretKey,