ファイル
nizika_video/server/core/helpers/threads.ts
T
2024-07-15 09:14:04 +09:00

9 行
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 })
}