fix: added MAX_CONCURRENCY limit as each webworker costs RAM, and machines with e.g 24 cores crash the process (#2161)
This commit is contained in:
1 parent
5121913ee6
commit
d2e777bafc
1 file changed
+3
-1
@@ -2,9 +2,11 @@ import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
|
||||
|
||||
let initialized = false;
|
||||
|
||||
const MAX_CONCURRENCY = 6;
|
||||
|
||||
export default function initWebWorkers() {
|
||||
const config = {
|
||||
maxWebWorkers: Math.max(navigator.hardwareConcurrency - 1, 1),
|
||||
maxWebWorkers: Math.max(Math.min(navigator.hardwareConcurrency - 1, MAX_CONCURRENCY), 1),
|
||||
startWebWorkersOnDemand: true,
|
||||
taskConfiguration: {
|
||||
decodeTask: {
|
||||
|
||||
Reference in new issue
Block a user