repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps): bump fastify
[poolifier.git]
/
tests
/
worker-files
/
cluster
/
asyncWorker.js
diff --git
a/tests/worker-files/cluster/asyncWorker.js
b/tests/worker-files/cluster/asyncWorker.js
index 975b0b365efb92dad4d24f44a20434f1267a4cd4..3ec0d9508849627e494139fd0d5b70517abd631c 100644
(file)
--- a/
tests/worker-files/cluster/asyncWorker.js
+++ b/
tests/worker-files/cluster/asyncWorker.js
@@
-1,10
+1,12
@@
'use strict'
'use strict'
-const { ClusterWorker } = require('../../../lib/index')
+const { ClusterWorker, KillBehaviors } = require('../../../lib')
+const { sleepTaskFunction } = require('../../test-utils.js')
async function sleep (data) {
async function sleep (data) {
- return new Promise((resolve, reject) => {
- setTimeout(() => resolve(data), 2000)
- })
+ return sleepTaskFunction(data, 2000)
}
}
-module.exports = new ClusterWorker(sleep, { maxInactiveTime: 500, async: true })
+module.exports = new ClusterWorker(sleep, {
+ killBehavior: KillBehaviors.HARD,
+ maxInactiveTime: 500
+})