Skip to content

Commit

Permalink
chore(NA): fix type problems for process.emit on nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Dec 7, 2019
1 parent 1256e3d commit 67041cb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/legacy/server/logging/rotate/log_rotator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,21 @@ export class LogRotator {

_sendReloadLogConfigSignal() {
if (isMaster) {
// @ts-ignore
process.emit('SIGHUP');
(process as NodeJS.EventEmitter).emit('SIGHUP');
return;
}

// Send a special message to the cluster manager
// so it can forward it correctly
// It will only run when we are under cluster mode (not under a production environment)
// @ts-ignore
if (!process.send) {
this.log(
['error', 'logging:rotate'],
'For some unknown reason process.send is not defined, the rotation was not successful'
);
return;
}

process.send(['RELOAD_LOGGING_CONFIG_FROM_SERVER_WORKER']);
}
}

0 comments on commit 67041cb

Please sign in to comment.