MCPcopy Index your code
hub / github.com/totaljs/framework / exec

Function exec

cluster.js:432–458  ·  view source on GitHub ↗
(index, https)

Source from the content-addressed store, hash-verified

430}
431
432function exec(index, https) {
433
434 if (TIMEOUTS[index]) {
435 clearTimeout(TIMEOUTS[index]);
436 delete TIMEOUTS[index];
437 }
438
439 var fork = Cluster.fork();
440 fork.$id = index.toString();
441 fork.on('message', message);
442 fork.on('exit', function() {
443 FORKS[index] = null;
444 TIMEOUTS[index] = setTimeout(exports.restart, 1000, index);
445 });
446
447 if (FORKS[index] === undefined)
448 FORKS.push(fork);
449 else
450 FORKS[index] = fork;
451
452 (function(fork) {
453 setTimeout(function() {
454 OPTIONS.options.id = fork.$id;
455 fork.send({ TYPE: 'init', bundling: !CONTINUE, id: fork.$id, mode: OPTIONS.mode, options: OPTIONS.options, threads: OPTIONS.count, index: index, https: https });
456 }, fork.$id * 500);
457 })(fork);
458}
459
460function fork() {
461 require('./index');

Callers 3

cluster.jsFile · 0.85
masterFunction · 0.85
image.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected