fix: Revert drogon thread to 1 instead of CPU num

This commit is contained in:
hiro 2023-12-12 07:27:25 +07:00
parent 577921f21f
commit 14f83ddb70

View File

@ -179,10 +179,8 @@ async function spawnNitroProcess(nitroResourceProbe: any): Promise<any> {
let binaryName; let binaryName;
if (process.platform === "win32") { if (process.platform === "win32") {
// Todo: Need to check for CUDA support to switch between CUDA and non-CUDA binaries
binaryName = "win-start.bat"; binaryName = "win-start.bat";
} else if (process.platform === "darwin") { } else if (process.platform === "darwin") {
// Mac OS platform
if (process.arch === "arm64") { if (process.arch === "arm64") {
binaryFolder = path.join(binaryFolder, "mac-arm64"); binaryFolder = path.join(binaryFolder, "mac-arm64");
} else { } else {
@ -190,21 +188,15 @@ async function spawnNitroProcess(nitroResourceProbe: any): Promise<any> {
} }
binaryName = "nitro"; binaryName = "nitro";
} else { } else {
// Linux binaryName = "linux-start.sh";
// Todo: Need to check for CUDA support to switch between CUDA and non-CUDA binaries
binaryName = "linux-start.sh"; // For other platforms
} }
const binaryPath = path.join(binaryFolder, binaryName); const binaryPath = path.join(binaryFolder, binaryName);
// Execute the binary // Execute the binary
subprocess = spawn( subprocess = spawn(binaryPath, [1, LOCAL_HOST, PORT], {
binaryPath,
[nitroResourceProbe.numCpuPhysicalCore, "127.0.0.1", PORT],
{
cwd: binaryFolder, cwd: binaryFolder,
} });
);
// Handle subprocess output // Handle subprocess output
subprocess.stdout.on("data", (data) => { subprocess.stdout.on("data", (data) => {
@ -274,7 +266,6 @@ function validateModelVersion(): Promise<void> {
}); });
} }
function dispose() { function dispose() {
// clean other registered resources here // clean other registered resources here
killSubprocess(); killSubprocess();