Skip to content

Commit

Permalink
engine: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
josephjclark committed Jan 24, 2024
1 parent d32de06 commit 625b89e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/engine-multi/src/worker/child/create-thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const createThread = (
maxOldGenerationSizeMb: options.memoryLimitMb,
},
});
worker.on('error', (err) => {
console.log('**** WORKER THREAD ERROR');
console.log(err);
});

worker.postMessage({
type: ENGINE_RUN_TASK,
Expand Down
4 changes: 4 additions & 0 deletions packages/engine-multi/src/worker/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ function createPool(script: string, options: PoolOptions = {}, logger: Logger) {
// maybe good in prod, maybe bad for dev
silent: options.silent,
});
child.on('error', (err) => {
console.log('**** CHiLD PROCESS ERROR');
console.log(err);
});
logger.debug('pool: Created new child process', child.pid);
allWorkers[child.pid!] = child;
} else {
Expand Down

0 comments on commit 625b89e

Please sign in to comment.