MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / finish

Function finish

lib/workers.js:54–76  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

52 },
53
54 finish(callback) {
55 debug('finish()');
56 if (!config.useWorkers) {
57 callback(null);
58 return;
59 }
60 const testFinished = () => {
61 if (availablePythonCallers.length < pythonCallers.length) {
62 // keep waiting for all pythonCallers to be returned
63 debug('finish(): waiting for availablePythonCallers');
64 setTimeout(testFinished, 100);
65 } else {
66 debug('finish(): calling done() on all pythonCallers');
67 for (let i = 0; i < pythonCallers.length; i++) {
68 pythonCallers[i].done();
69 }
70 pythonCallers = [];
71 availablePythonCallers = [];
72 return callback(null);
73 }
74 };
75 testFinished();
76 },
77
78 getPythonCaller(callback) {
79 debug('getPythonCaller()');

Callers

nothing calls this directly

Calls 3

debugFunction · 0.85
callbackFunction · 0.85
testFinishedFunction · 0.70

Tested by

no test coverage detected