fix & opt

- sftp download unknown spent time
- shareFiles return bool
This commit is contained in:
Junyuan Feng
2022-05-08 09:07:03 +08:00
parent b0c3cd3834
commit 6f30976ef7
13 changed files with 71 additions and 28 deletions

View File

@@ -82,7 +82,7 @@ class SftpDownloadWorker {
mainSendPort.send(Exception('can not get file size'));
return;
}
const defaultChunkSize = 1024 * 512;
const defaultChunkSize = 1024 * 1024;
final chunkSize = size > defaultChunkSize ? defaultChunkSize : size;
mainSendPort.send(size);
mainSendPort.send(SftpWorkerStatus.downloading);
@@ -93,9 +93,9 @@ class SftpDownloadWorker {
mainSendPort.send((i + form.length) / size * 100);
}
}
mainSendPort.send(SftpWorkerStatus.finished);
localFile.close();
mainSendPort.send(watch.elapsed);
mainSendPort.send(SftpWorkerStatus.finished);
} catch (e) {
mainSendPort.send(e);
}