Files
SolTube/server/core/helpers/threads.ts
ShreejitPanchal 6601501eff Init commit
2026-05-19 19:56:02 +08:00

12 lines
357 B
TypeScript

import { isTestOrDevInstance } from '@peertube/peertube-node-utils'
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 })
if (isTestOrDevInstance()) process.exit(1)
}