Commit | Line | Data |
---|---|---|
325f50bc | 1 | 'use strict' |
1641b313 | 2 | const { isMaster } = require('cluster') |
65d7a1c9 | 3 | const { ClusterWorker, KillBehaviors } = require('../../../lib') |
bdacc2d2 | 4 | const TestUtils = require('../../test-utils') |
2d2e32c2 | 5 | const { WorkerFunctions } = require('../../test-types') |
325f50bc S |
6 | |
7 | function test (data) { | |
6db75ad9 JB |
8 | data = data || {} |
9 | data.function = data.function || WorkerFunctions.jsonIntegerSerialization | |
10 | TestUtils.executeWorkerFunction(data) | |
1641b313 | 11 | return isMaster |
325f50bc S |
12 | } |
13 | ||
4c35177b | 14 | module.exports = new ClusterWorker(test, { |
15 | maxInactiveTime: 500, | |
1a81f8af | 16 | killBehavior: KillBehaviors.HARD |
4c35177b | 17 | }) |