mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
fix & opt
- sftp download unknown spent time - shareFiles return bool
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user