build: switch default to ESM
[poolifier.git] / tests / worker-files / cluster / longRunningWorkerHardBehavior.cjs
diff --git a/tests/worker-files/cluster/longRunningWorkerHardBehavior.cjs b/tests/worker-files/cluster/longRunningWorkerHardBehavior.cjs
new file mode 100644 (file)
index 0000000..2d7de52
--- /dev/null
@@ -0,0 +1,12 @@
+'use strict'
+const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
+const { sleepTaskFunction } = require('../../test-utils.cjs')
+
+async function sleep (data) {
+  return sleepTaskFunction(data, 50000)
+}
+
+module.exports = new ClusterWorker(sleep, {
+  killBehavior: KillBehaviors.HARD,
+  maxInactiveTime: 500
+})