Skip to content

Commit a4e177b

Browse files
bug fixes
1 parent 3eece88 commit a4e177b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nsfwDetection/nsfwProcess.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import path from 'path';
33
import os from 'os';
44

55
const nsfwServicePath = path.resolve('nsfwDetection/nsfwService.cjs');
6-
const WORKER_COUNT = os.cpus().length; // Use number of CPU cores
7-
const WORKER_TIMEOUT = 5000; // 5 seconds per request
6+
const WORKER_COUNT = Math.max(1, os.cpus().length - 1); // Leave 1 core free
7+
const WORKER_TIMEOUT = 15000; // 5 seconds per request
88

99
let workers = [];
1010
let readyWorkers = new Set();

0 commit comments

Comments
 (0)