0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
posthog/plugin-server/tests/helpers/worker.ts
James Greenhill 434e379f9a Add 'plugin-server/' from commit '01a99a4e26b0b11f068a7073d6b94e53a7214d33'
git-subtree-dir: plugin-server
git-subtree-mainline: 776b056b6d
git-subtree-split: 01a99a4e26
2021-10-28 14:59:19 -07:00

15 lines
448 B
TypeScript

import Piscina from '@posthog/piscina'
import { defaultConfig } from '../../src/config/config'
import { LogLevel } from '../../src/types'
import { makePiscina } from '../../src/worker/piscina'
export function setupPiscina(workers: number, tasksPerWorker: number): Piscina {
return makePiscina({
...defaultConfig,
WORKER_CONCURRENCY: workers,
TASKS_PER_WORKER: tasksPerWorker,
LOG_LEVEL: LogLevel.Log,
})
}