MCPcopy Index your code
hub / github.com/PrairieLearn/PrairieLearn / init

Function init

lib/workers.js:35–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34module.exports = {
35 init() {
36 debug('init()');
37 if (!config.useWorkers) {
38 return;
39 }
40 var numWorkers = config.workersCount;
41 if (numWorkers == null) {
42 numWorkers = Math.ceil(config.workersPerCpu * os.cpus().length);
43 }
44 for (let i = 0; i < numWorkers; i++) {
45 const pc = new codeCaller.PythonCaller();
46 pc.number = i;
47 pythonCallers.push(pc);
48 load.startJob('python_worker_idle', pc.uuid);
49 availablePythonCallers.push(pc);
50 }
51 module.exports._warmUpWorkers();
52 },
53
54 finish(callback) {
55 debug('finish()');

Callers

nothing calls this directly

Calls 2

debugFunction · 0.85
startJobMethod · 0.80

Tested by

no test coverage detected