From 98d38e733390f1c62ad37fdc8776ac56cf1458a2 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 14 Jul 2023 01:06:31 -0500 Subject: [PATCH] fix: gently log the port on which the realtime service listens (#21575) * fix: gently log the port on which the realtime service listens without this, the service remains completely silent (e.g. in overmind) and it is hard to tell if it is even running * Revert "fix: gently log the port on which the realtime service listens" This reverts commit 14a21989c6767520d8e1b9d46cc9f58a45768563. * refactor(socketio): explicitly listen on port --------- Co-authored-by: Ankush Menat --- realtime/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/realtime/index.js b/realtime/index.js index cf6549d521..ecc6063ca4 100644 --- a/realtime/index.js +++ b/realtime/index.js @@ -3,7 +3,7 @@ const { Server } = require("socket.io"); const { get_conf, get_redis_subscriber } = require("../node_utils"); const conf = get_conf(); -let io = new Server(conf.socketio_port, { +let io = new Server({ cors: { // Should be fine since we are ensuring whether hostname and origin are same before adding setting listeners for s socket origin: true, @@ -52,3 +52,7 @@ subscriber.on("message", function (_channel, message) { subscriber.subscribe("events"); // ======================= + +let port = conf.socketio_port; +io.listen(port); +console.log("Realtime service listening on: ", port);