1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Don't use file logger in worker threads

This commit is contained in:
Chocobozzz 2025-05-13 16:06:37 +02:00
parent 1aa9ff8aa4
commit fd2292c723
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 20 additions and 8 deletions

View file

@ -1,3 +1,4 @@
import { isTestOrDevInstance } from '@peertube/peertube-node-utils'
import { isMainThread } from 'node:worker_threads'
import { logger } from './logger.js'
@ -5,4 +6,6 @@ export function assertIsInWorkerThread () {
if (!isMainThread) return
logger.error('Caller is not in worker thread', { stack: new Error().stack })
if (isTestOrDevInstance()) process.exit(1)
}