config: add reconnectMaxRetries to configure reconnection behavior

This commit is contained in:
DataHoarder 2023-06-07 11:35:42 +02:00
parent ae9d312b2a
commit 2f1620927f
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
3 changed files with 10 additions and 3 deletions

View file

@ -43,6 +43,14 @@ module.exports = {
// pick its preferred one.
bind: undefined,
// ### `reconnectMaxRetries`
//
// Sets the number of times that reconnection will be attempted.
//
// Exponential backoff maxes out at 300 seconds after 9 reconnects,
// defaults at 30 for well over an hour (plus the timeouts)
reconnectMaxRetries: 30,
// ### `reverseProxy`
//
// When set to `true`, The Lounge is marked as served behind a reverse proxy

View file

@ -81,6 +81,7 @@ export type ConfigType = {
host: string | undefined;
port: number;
bind: string | undefined;
reconnectMaxRetries: number;
reverseProxy: boolean;
maxHistory: number;
https: Https;

View file

@ -305,9 +305,7 @@ class Network {
enable_setname: true,
auto_reconnect: true,
// Exponential backoff maxes out at 300 seconds after 9 reconnects,
// it will keep trying for well over an hour (plus the timeouts)
auto_reconnect_max_retries: 30,
auto_reconnect_max_retries: Config.values.reconnectMaxRetries,
// TODO: this type should be set after setIrcFrameworkOptions
}) as NetworkWithIrcFramework["irc"];