()
| 256 | let waitingCount = 1; |
| 257 | |
| 258 | function checkWaitingCount() { |
| 259 | waitingCount--; |
| 260 | |
| 261 | if (waitingCount === 0) { |
| 262 | // If disconnect is worker initiated, wait for ack to be sure |
| 263 | // exitedAfterDisconnect is properly set in the primary, otherwise, if |
| 264 | // it's primary initiated there's no need to send the |
| 265 | // exitedAfterDisconnect message |
| 266 | if (primaryInitiated) { |
| 267 | process.disconnect(); |
| 268 | } else { |
| 269 | send({ act: 'exitedAfterDisconnect' }, () => process.disconnect()); |
| 270 | } |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | for (const handle of handles.values()) { |
| 275 | waitingCount++; |
no test coverage detected
searching dependent graphs…