mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
chore: add graceful shutdown
This commit is contained in:
@@ -7,7 +7,8 @@ let io: SocketIO;
|
||||
|
||||
export const initIO = (httpServer: Server): SocketIO => {
|
||||
io = socketIo(httpServer);
|
||||
if (process.env.IO_REDIS_SERVER) {
|
||||
|
||||
if (process.env.NODE_ENV === "PRODUCTION") {
|
||||
io.adapter(
|
||||
socketRedis({
|
||||
host: process.env.IO_REDIS_SERVER,
|
||||
@@ -15,6 +16,7 @@ export const initIO = (httpServer: Server): SocketIO => {
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
io.on("connection", socket => {
|
||||
console.log("Client Connected");
|
||||
socket.on("joinChatBox", ticketId => {
|
||||
|
||||
Reference in New Issue
Block a user