Commit | Line | Data |
---|---|---|
1 | import { threadId } from 'worker_threads'; | |
2 | ||
3 | import chalk from 'chalk'; | |
4 | ||
5 | export class WorkerUtils { | |
6 | private constructor() { | |
7 | // This is intentional | |
8 | } | |
9 | ||
10 | public static defaultExitHandler = (code: number): void => { | |
11 | if (code !== 0) { | |
12 | console.error(chalk.red(`Worker ${threadId} stopped with exit code ${code}`)); | |
13 | } | |
14 | }; | |
15 | } |