Wire remote player reconnect delay

This commit is contained in:
2026-08-08 16:29:38 +01:00
parent 5a08ccddbb
commit 38565a533d
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -10,15 +10,15 @@ services:
ports: ports:
- "8081:8081" - "8081:8081"
environment: environment:
PLAYER_IDENTIFIER: ${PLAYER_IDENTIFIER:-player-remote}
PLAYER_PUBLIC_URL: ${PLAYER_PUBLIC_URL:-http://localhost:8081} PLAYER_PUBLIC_URL: ${PLAYER_PUBLIC_URL:-http://localhost:8081}
BRIDGE_PUBLIC_URL: ${BRIDGE_PUBLIC_URL:-} BRIDGE_PUBLIC_URL: ${BRIDGE_PUBLIC_URL:-}
PULSE_SIGNAGE_SHARED_SECRET: ${PULSE_SIGNAGE_SHARED_SECRET:-} PULSE_SIGNAGE_SHARED_SECRET: ${PULSE_SIGNAGE_SHARED_SECRET:-}
PLAYER_AGENT_RECONNECT_DELAY_MS: ${PLAYER_AGENT_RECONNECT_DELAY_MS:-5000}
volumes: volumes:
- pulse-signage:/app/media - pulse-signage:/app/media
command: ["node", "src/player.js"] command: ["node", "src/player.js"]
volumes: volumes:
pulse-signage: pulse-signage:
+2 -1
View File
@@ -25,6 +25,7 @@ async function start() {
const isRemotePlayer = Boolean(BRIDGE_PUBLIC_URL); const isRemotePlayer = Boolean(BRIDGE_PUBLIC_URL);
const PLAYER_INTERNAL_URL = String(isRemotePlayer ? BRIDGE_PUBLIC_URL : (process.env.PLAYER_INTERNAL_URL || PLAYER_PUBLIC_URL || process.env.PLAYER_BASE_URL || '')).trim().replace(/\/$/, ''); const PLAYER_INTERNAL_URL = String(isRemotePlayer ? BRIDGE_PUBLIC_URL : (process.env.PLAYER_INTERNAL_URL || PLAYER_PUBLIC_URL || process.env.PLAYER_BASE_URL || '')).trim().replace(/\/$/, '');
const PLAYER_DEVICE_ID = getConfiguredPlayerIdentifier(); const PLAYER_DEVICE_ID = getConfiguredPlayerIdentifier();
const PLAYER_AGENT_RECONNECT_DELAY_MS = Number(process.env.PLAYER_AGENT_RECONNECT_DELAY_MS || 5000);
const ASSET_DIR = path.join(__dirname, 'player', 'public'); const ASSET_DIR = path.join(__dirname, 'player', 'public');
const MEDIA_DIR = path.join(__dirname, '..', 'media'); const MEDIA_DIR = path.join(__dirname, '..', 'media');
const ONBOARDING_QUEUE_FILE = path.join(MEDIA_DIR, 'player-onboarding-queue.json'); const ONBOARDING_QUEUE_FILE = path.join(MEDIA_DIR, 'player-onboarding-queue.json');
@@ -356,7 +357,7 @@ async function start() {
socket.on('close', function () { socket.on('close', function () {
clearTimers(); clearTimers();
thinClientSocket = null; thinClientSocket = null;
reconnectTimer = setTimeout(connect, 5000); reconnectTimer = setTimeout(connect, PLAYER_AGENT_RECONNECT_DELAY_MS);
}); });
socket.on('error', function () { socket.on('error', function () {