diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index ee3be6d2ee..ae86aae6aa 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -868,6 +868,8 @@ const _ProjectController = { editorThemes: THEME_LIST, legacyEditorThemes: LEGACY_THEME_LIST, maxDocLength: Settings.max_doc_length, + maxReconnectGracefullyIntervalMs: + Settings.maxReconnectGracefullyIntervalMs, brandVariation, allowedImageNames, gitBridgePublicBaseUrl: Settings.gitBridgePublicBaseUrl, diff --git a/services/web/app/views/project/editor/_meta.pug b/services/web/app/views/project/editor/_meta.pug index 8f24e94906..720802aba8 100644 --- a/services/web/app/views/project/editor/_meta.pug +++ b/services/web/app/views/project/editor/_meta.pug @@ -8,6 +8,7 @@ meta(name="ol-brandVariation" data-type="json" content=brandVariation) meta(name="ol-isTokenMember" data-type="boolean" content=isTokenMember) meta(name="ol-isRestrictedTokenMember" data-type="boolean" content=isRestrictedTokenMember) meta(name="ol-maxDocLength" data-type="json" content=maxDocLength) +meta(name="ol-maxReconnectGracefullyIntervalMs" data-type="json" content=maxReconnectGracefullyIntervalMs) meta(name="ol-wikiEnabled" data-type="boolean" content=settings.proxyLearn) meta(name="ol-chatEnabled" data-type="boolean" content=chatEnabled) meta(name="ol-projectHistoryBlobsEnabled" data-type="boolean" content=projectHistoryBlobsEnabled) diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index c8bd7a831c..1f86da66a0 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -660,6 +660,11 @@ module.exports = { gracefulShutdownDelayInMs: parseInt(process.env.GRACEFUL_SHUTDOWN_DELAY_SECONDS ?? '5', 10) * seconds, + maxReconnectGracefullyIntervalMs: parseInt( + process.env.MAX_RECONNECT_GRACEFULLY_INTERVAL_MS ?? '30000', + 10 + ), + // Expose the hostname in the `X-Served-By` response header exposeHostname: process.env.EXPOSE_HOSTNAME === 'true', diff --git a/services/web/frontend/js/features/ide-react/connection/connection-manager.ts b/services/web/frontend/js/features/ide-react/connection/connection-manager.ts index 1402a983ce..a72142f4d5 100644 --- a/services/web/frontend/js/features/ide-react/connection/connection-manager.ts +++ b/services/web/frontend/js/features/ide-react/connection/connection-manager.ts @@ -21,7 +21,9 @@ const JOIN_PROJECT_RATE_LIMITED_DELAY = 15 * 1000 const BACK_OFF_RECONNECT_OFFLINE = 5000 const RECONNECT_GRACEFULLY_RETRY_INTERVAL_MS = 5000 -const MAX_RECONNECT_GRACEFULLY_INTERVAL_MS = 45 * 1000 +const MAX_RECONNECT_GRACEFULLY_INTERVAL_MS = getMeta( + 'ol-maxReconnectGracefullyIntervalMs' +) const BEFORE_RECONNECT = 'beforeReconnect' diff --git a/services/web/frontend/js/utils/meta.ts b/services/web/frontend/js/utils/meta.ts index 7922f9f0cb..0f188c0976 100644 --- a/services/web/frontend/js/utils/meta.ts +++ b/services/web/frontend/js/utils/meta.ts @@ -151,6 +151,7 @@ export interface Meta { 'ol-managers': MinimalUser[] 'ol-mathJaxPath': string 'ol-maxDocLength': number + 'ol-maxReconnectGracefullyIntervalMs': number 'ol-memberGroupSubscriptions': MemberGroupSubscription[] 'ol-memberOfSSOEnabledGroups': GroupSSOLinkingStatus[] 'ol-members': MinimalUser[]