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:
parent
1aa9ff8aa4
commit
fd2292c723
2 changed files with 20 additions and 8 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue