Skip to content

Commit

Permalink
fixed concurrent downloads (#254)
Browse files Browse the repository at this point in the history
* Hotfix for login

* Fixed forge patching on paths with whitespaces

* v0.12.3

* fixed concurrent downloads
  • Loading branch information
blarfoon authored Oct 16, 2019
1 parent ec5cec1 commit f7e9fbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/actions/downloadManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export function downloadPack(pack, isRepair = false) {
modsManifest = modsManifest.concat(modManifest);
dispatch(updateDownloadProgress(15, 15, modsDownloaded, manifest.files.length));
},
{ concurrency: cpus().length + 2 }
{ concurrency: 3 }
);
} catch (err) {
log.error(err);
Expand Down Expand Up @@ -463,7 +463,7 @@ export function downloadPack(pack, isRepair = false) {
? [...libraries, ...assets, ...mainJar, legacyJavaFixer]
: [...libraries, ...assets, ...mainJar];

await downloadArr(allFiles, updatePercentage, pack, isRepair);
await downloadArr(allFiles, updatePercentage, pack, isRepair, 3);

if (vnlJSON.assets === 'legacy') {
await copyAssetsToLegacy(assets);
Expand Down
4 changes: 2 additions & 2 deletions app/utils/downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const downloadArr = async (
updatePercentage,
pack,
forceDownload = false,
threads = cpus().length
threads = 3
) => {
let downloaded = 0;
await Promise.map(
Expand Down Expand Up @@ -45,7 +45,7 @@ export const downloadArr = async (
if (downloaded % 10 === 0 || downloaded === arr.length)
updatePercentage(downloaded);
},
{ concurrency: threads + 2 }
{ concurrency: 3 }
);
};

Expand Down

0 comments on commit f7e9fbb

Please sign in to comment.