fix: handle chunkSize

This commit is contained in:
thecodrr
2021-10-30 13:49:41 +05:00
parent 148b88f10d
commit 36597616cc
4 changed files with 38 additions and 13 deletions

View File

@@ -8,11 +8,12 @@ export default class FileStorage {
this._queue = [];
}
async downloadFile(groupId, hash) {
async downloadFile(groupId, hash, chunkSize) {
const url = `${hosts.API_HOST}/s3?name=${hash}`;
const token = await this.tokenManager.getAccessToken();
const { execute, cancel } = this.fs.downloadFile(hash, {
url,
chunkSize,
headers: { Authorization: `Bearer ${token}` },
});
this._queue.push({ groupId, hash, cancel, type: "download" });