repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
docs: enhance documentation and update changelog entries
[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..b9ad419f82f97e61646ecd6c35cbb89ab9b6ec83 100644
(file)
--- a/
tests/worker-files/cluster/asyncWorker.js
+++ b/
tests/worker-files/cluster/asyncWorker.js
@@
-1,10
+1,13
@@
'use strict'
'use strict'
-const { ClusterWorker } = require('../../../lib/index')
+const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
+const TestUtils = require('../../test-utils')
async function sleep (data) {
async function sleep (data) {
- return new Promise((resolve, reject) => {
- setTimeout(() => resolve(data), 2000)
- })
+ return TestUtils.sleepWorkerFunction(data, 2000)
}
}
-module.exports = new ClusterWorker(sleep, { maxInactiveTime: 500, async: true })
+module.exports = new ClusterWorker(sleep, {
+ maxInactiveTime: 500,
+ async: true,
+ killBehavior: KillBehaviors.HARD
+})