mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Sign JSON objects in worker threads
This commit is contained in:
parent
9e2166a16f
commit
edc3ff6085
12 changed files with 185 additions and 48 deletions
8
server/core/helpers/threads.ts
Normal file
8
server/core/helpers/threads.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
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 })
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue