FIX: in dev mode, sockets won't be closed to prevent conflicts with live-reloading
This commit is contained in:
parent
1080328afa
commit
5a1147866c
@ -10,6 +10,7 @@ const CPU_OVERHEAT_THRESHOLD = Number(process.env.CPU_OVERHEAT_THRESHOLD) || 80;
|
|||||||
const JITSI_URL : string|undefined = (process.env.JITSI_URL === '') ? undefined : process.env.JITSI_URL;
|
const JITSI_URL : string|undefined = (process.env.JITSI_URL === '') ? undefined : process.env.JITSI_URL;
|
||||||
const JITSI_ISS = process.env.JITSI_ISS || '';
|
const JITSI_ISS = process.env.JITSI_ISS || '';
|
||||||
const SECRET_JITSI_KEY = process.env.SECRET_JITSI_KEY || '';
|
const SECRET_JITSI_KEY = process.env.SECRET_JITSI_KEY || '';
|
||||||
|
const DEV_MODE = process.env.DEV_MODE || false;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
SECRET_KEY,
|
SECRET_KEY,
|
||||||
@ -21,6 +22,7 @@ export {
|
|||||||
GROUP_RADIUS,
|
GROUP_RADIUS,
|
||||||
ALLOW_ARTILLERY,
|
ALLOW_ARTILLERY,
|
||||||
CPU_OVERHEAT_THRESHOLD,
|
CPU_OVERHEAT_THRESHOLD,
|
||||||
|
DEV_MODE,
|
||||||
JITSI_URL,
|
JITSI_URL,
|
||||||
JITSI_ISS,
|
JITSI_ISS,
|
||||||
SECRET_JITSI_KEY
|
SECRET_JITSI_KEY
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import {ExSocketInterface} from "_Model/Websocket/ExSocketInterface";
|
import {ExSocketInterface} from "_Model/Websocket/ExSocketInterface";
|
||||||
import {BatchMessage, ErrorMessage, ServerToClientMessage, SubMessage} from "../Messages/generated/messages_pb";
|
import {BatchMessage, ErrorMessage, ServerToClientMessage, SubMessage} from "../Messages/generated/messages_pb";
|
||||||
|
import {DEV_MODE} from "../Enum/EnvironmentVariable";
|
||||||
|
|
||||||
export function emitInBatch(socket: ExSocketInterface, payload: SubMessage): void {
|
export function emitInBatch(socket: ExSocketInterface, payload: SubMessage): void {
|
||||||
socket.batchedMessages.addPayload(payload);
|
socket.batchedMessages.addPayload(payload);
|
||||||
@ -52,6 +53,7 @@ export function emitError(Client: ExSocketInterface, message: string): void {
|
|||||||
export const pongMaxInterval = 30000; // the maximum duration (in ms) between pongs before we shutdown the connexion.
|
export const pongMaxInterval = 30000; // the maximum duration (in ms) between pongs before we shutdown the connexion.
|
||||||
|
|
||||||
export function refresLogoutTimerOnPong(ws: ExSocketInterface): void {
|
export function refresLogoutTimerOnPong(ws: ExSocketInterface): void {
|
||||||
|
if (DEV_MODE) return; //this feature is disabled in dev mode as it clashes with live reload.
|
||||||
if(ws.pongTimeout) clearTimeout(ws.pongTimeout);
|
if(ws.pongTimeout) clearTimeout(ws.pongTimeout);
|
||||||
ws.pongTimeout = setTimeout(() => {
|
ws.pongTimeout = setTimeout(() => {
|
||||||
ws.close();
|
ws.close();
|
||||||
|
@ -78,6 +78,7 @@ services:
|
|||||||
ADMIN_API_TOKEN: "$ADMIN_API_TOKEN"
|
ADMIN_API_TOKEN: "$ADMIN_API_TOKEN"
|
||||||
JITSI_URL: $JITSI_URL
|
JITSI_URL: $JITSI_URL
|
||||||
JITSI_ISS: $JITSI_ISS
|
JITSI_ISS: $JITSI_ISS
|
||||||
|
DEV_MODE: "1"
|
||||||
volumes:
|
volumes:
|
||||||
- ./back:/usr/src/app
|
- ./back:/usr/src/app
|
||||||
labels:
|
labels:
|
||||||
|
Loading…
Reference in New Issue
Block a user