Config for UDP connection request port (#221)

This commit is contained in:
Spencer Lambert authored and Zaid Abdulla committed 2017-03-31 11:14:44 -07:00
1 parent 84e79bda9e
commit 6338f9f07c
3 files changed
+20 -7

No files matched your search

+11 -6
View File
@@ -68,6 +68,8 @@ function restartWorker(worker, code, signal) {
function start(service) {
logger.init(service, VERSION);
const config = require("./config");
const SERVICE_ADDRESS = config.get(`${service.toUpperCase()}_INTERFACE`)
const SERVICE_PORT = config.get(`${service.toUpperCase()}_PORT`)
logger.info({
message: `GenieACS (genieacs-${service}) starting`,
@@ -78,12 +80,15 @@ function start(service) {
});
cluster.on("listening", function(worker, address) {
logger.info({
message: "Worker listening",
pid: worker.process.pid,
address: address.address,
port: address.port
});
if ((address.addressType === 4 || address.addressType === 6) &&
address.address === SERVICE_ADDRESS && address.port === SERVICE_PORT) {
logger.info({
message: "Worker listening",
pid: worker.process.pid,
address: address.address,
port: address.port
});
}
});
cluster.on("exit", restartWorker);