From 38565a533d92e730eb227f39895f18970b01a27f Mon Sep 17 00:00:00 2001 From: Mark Rapson Date: Sat, 8 Aug 2026 16:29:38 +0100 Subject: [PATCH] Wire remote player reconnect delay --- docker-compose/docker-compose.remote.yml | 4 ++-- src/player.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose/docker-compose.remote.yml b/docker-compose/docker-compose.remote.yml index 1b62cd8..1122899 100644 --- a/docker-compose/docker-compose.remote.yml +++ b/docker-compose/docker-compose.remote.yml @@ -10,15 +10,15 @@ services: ports: - "8081:8081" environment: + PLAYER_IDENTIFIER: ${PLAYER_IDENTIFIER:-player-remote} PLAYER_PUBLIC_URL: ${PLAYER_PUBLIC_URL:-http://localhost:8081} BRIDGE_PUBLIC_URL: ${BRIDGE_PUBLIC_URL:-} PULSE_SIGNAGE_SHARED_SECRET: ${PULSE_SIGNAGE_SHARED_SECRET:-} + PLAYER_AGENT_RECONNECT_DELAY_MS: ${PLAYER_AGENT_RECONNECT_DELAY_MS:-5000} volumes: - pulse-signage:/app/media command: ["node", "src/player.js"] - - volumes: pulse-signage: diff --git a/src/player.js b/src/player.js index bad8577..737fc9e 100644 --- a/src/player.js +++ b/src/player.js @@ -25,6 +25,7 @@ async function start() { 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_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 MEDIA_DIR = path.join(__dirname, '..', 'media'); const ONBOARDING_QUEUE_FILE = path.join(MEDIA_DIR, 'player-onboarding-queue.json'); @@ -356,7 +357,7 @@ async function start() { socket.on('close', function () { clearTimers(); thinClientSocket = null; - reconnectTimer = setTimeout(connect, 5000); + reconnectTimer = setTimeout(connect, PLAYER_AGENT_RECONNECT_DELAY_MS); }); socket.on('error', function () {