mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 21:00:01 +00:00

Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
16 lines
505 B
JavaScript
16 lines
505 B
JavaScript
'use strict';
|
|
var cluster = require('cluster');
|
|
|
|
if (cluster.isMaster) {
|
|
var worker = cluster.fork().on('online', disconnect);
|
|
|
|
function disconnect() {
|
|
worker.disconnect();
|
|
// The worker remains in cluster.workers until both disconnect AND exit.
|
|
// Disconnect is supposed to disconnect all workers, but not workers that
|
|
// are already disconnected, since calling disconnect() on an already
|
|
// disconnected worker would error.
|
|
worker.on('disconnect', cluster.disconnect);
|
|
}
|
|
}
|