Listen to SIGHUP and reload users
Listens for a 'SIGHUP' signal and reloads users when it gets one. The signal won't be listened to if its running on Windows as a SIGHUP indicates a console window closing.
This commit is contained in:
parent
40f8a4ddc4
commit
0ba67481fb
|
@ -8,7 +8,14 @@ var moment = require("moment");
|
||||||
module.exports = ClientManager;
|
module.exports = ClientManager;
|
||||||
|
|
||||||
function ClientManager() {
|
function ClientManager() {
|
||||||
|
var self = this;
|
||||||
this.clients = [];
|
this.clients = [];
|
||||||
|
if(!/^win/.test(process.platform)) {
|
||||||
|
process.on('SIGHUP', function() {
|
||||||
|
console.log("Received 'SIGHUP'. Reloading Users.");
|
||||||
|
self.loadUsers();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientManager.prototype.findClient = function(name) {
|
ClientManager.prototype.findClient = function(name) {
|
||||||
|
|
Loading…
Reference in New Issue