Pass sock
in recursive acceptJob
calls (#65)
This commit is contained in:
parent
bd486f5c04
commit
d25639c0ec
1 changed files with 2 additions and 2 deletions
|
@ -32,14 +32,14 @@ const acceptJob = async (uuid, sock) => {
|
|||
}, sock);
|
||||
jobAmount--;
|
||||
if (queue.length > 0) {
|
||||
acceptJob(queue[0]);
|
||||
acceptJob(queue[0], sock);
|
||||
}
|
||||
log(`Job ${uuid} has finished`);
|
||||
} catch (err) {
|
||||
console.error(`Error on job ${uuid}:`, err);
|
||||
jobAmount--;
|
||||
if (queue.length > 0) {
|
||||
acceptJob(queue[0]);
|
||||
acceptJob(queue[0], sock);
|
||||
}
|
||||
delete jobs[uuid];
|
||||
sock.write(Buffer.concat([Buffer.from([0x2]), Buffer.from(uuid), Buffer.from(err.toString())]));
|
||||
|
|
Loading…
Reference in a new issue