1
0
Fork 0
peertube/server/core/helpers/threads.ts

9 lines
243 B
TypeScript
Raw Normal View History

2023-10-24 04:45:17 -04:00
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 })
}