You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
243 B
TypeScript
9 lines
243 B
TypeScript
import { isMainThread } from 'node:worker_threads'
|
|||
import { logger } from './logger.js'
|
|||
|
|||
export function assertIsInWorkerThread () {
|
|||
if (!isMainThread) return
|
|||
|
|||
logger.error('Caller is not in worker thread', { stack: new Error().stack })
|
|||
}
|