filename: './workers/piscina/function-to-bench-worker.js',
minThreads: size,
maxThreads: size * 3,
- idleTimeout: 1000 * 60 // this is the same as poolifier default
+ idleTimeout: 60000 // this is the same as poolifier default
})
async function run () {
const piscina = new Piscina({
filename: './workers/piscina/function-to-bench-worker.js',
minThreads: size,
- idleTimeout: 1000 * 60 // this is the same as poolifier default
+ idleTimeout: 60000 // this is the same as poolifier default
})
async function run () {
import type { KillBehavior, WorkerOptions } from './worker-options'
import { KillBehaviors } from './worker-options'
-const DEFAULT_MAX_INACTIVE_TIME = 1000 * 60
+const DEFAULT_MAX_INACTIVE_TIME = 60000
const DEFAULT_KILL_BEHAVIOR: KillBehavior = KillBehaviors.SOFT
/**
it('Verify worker options default values', () => {
const worker = new ThreadWorker(() => {})
- expect(worker.opts.maxInactiveTime).toBe(1000 * 60)
+ expect(worker.opts.maxInactiveTime).toStrictEqual(60000)
expect(worker.opts.killBehavior).toBe(KillBehaviors.SOFT)
expect(worker.opts.async).toBe(false)
})
async: true,
killBehavior: KillBehaviors.HARD
})
- expect(worker.opts.maxInactiveTime).toBe(6000)
+ expect(worker.opts.maxInactiveTime).toStrictEqual(6000)
expect(worker.opts.killBehavior).toBe(KillBehaviors.HARD)
expect(worker.opts.async).toBe(true)
})