Merge pull request #698 from Rxflex/main

[BUGFIX] Fixing downloading class (wip)
This commit is contained in:
Chubby Granny Chaser 2024-06-26 17:37:49 +01:00 committed by GitHub
commit 024c28dcb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}; };