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