mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
Merge pull request #698 from Rxflex/main
[BUGFIX] Fixing downloading class (wip)
This commit is contained in:
commit
024c28dcb2
@ -7,14 +7,35 @@ export const startAria2 = () => {
|
|||||||
? path.join(process.resourcesPath, "aria2", "aria2c")
|
? path.join(process.resourcesPath, "aria2", "aria2c")
|
||||||
: path.join(__dirname, "..", "..", "aria2", "aria2c");
|
: path.join(__dirname, "..", "..", "aria2", "aria2c");
|
||||||
|
|
||||||
return spawn(
|
const aria2Process = spawn(
|
||||||
binaryPath,
|
binaryPath,
|
||||||
[
|
[
|
||||||
"--enable-rpc",
|
"--enable-rpc",
|
||||||
"--rpc-listen-all",
|
"--rpc-listen-all",
|
||||||
"--file-allocation=none",
|
"--file-allocation=none",
|
||||||
"--allow-overwrite=true",
|
"--allow-overwrite=true",
|
||||||
|
"--log-level=debug",
|
||||||
|
"--no-conf",
|
||||||
|
"--disk-cache=128M",
|
||||||
|
"-x16",
|
||||||
|
"-s16",
|
||||||
],
|
],
|
||||||
{ stdio: "inherit", windowsHide: true }
|
{ stdio: "inherit", windowsHide: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
aria2Process.on("error", (err) => {
|
||||||
|
console.error("Aria2 process error:", err);
|
||||||
|
});
|
||||||
|
|
||||||
|
aria2Process.on("exit", (code, signal) => {
|
||||||
|
if (code !== 0) {
|
||||||
|
console.error(
|
||||||
|
`Aria2 process exited with code ${code} and signal ${signal}`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log("Aria2 process exited successfully");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return aria2Process;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user