Add test cases and fixed some sonar code smells
[poolifier.git] / tests / worker / cluster / longRunningWorkerHardBehavior.js
CommitLineData
4c35177b 1'use strict'
e8ea58d2 2const { ClusterWorker, killBehaviorTypes } = require('../../../lib/index')
4c35177b 3
4async function sleep (data) {
5 return new Promise((resolve, reject) => {
6 setTimeout(() => resolve(data), 50000)
7 })
8}
9
10module.exports = new ClusterWorker(sleep, {
11 maxInactiveTime: 500,
12 async: true,
e8ea58d2 13 killBehavior: killBehaviorTypes.HARD
4c35177b 14})