From 1558816a7e492fe68e8c9f39e5c50e7f5153ba84 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 26 Aug 2023 21:39:34 +0200 Subject: [PATCH] server: drop TODO about configurable vars It might make sense to make some of these configurable, some not. We'll decide on a case-by-case basis if/when good use-cases come up. --- server.go | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/server.go b/server.go index e54e47b..00d7560 100644 --- a/server.go +++ b/server.go @@ -26,21 +26,22 @@ import ( "git.sr.ht/~emersion/soju/identd" ) -// TODO: make configurable -var retryConnectMinDelay = time.Minute -var retryConnectMaxDelay = 10 * time.Minute -var retryConnectJitter = time.Minute -var connectTimeout = 15 * time.Second -var writeTimeout = 10 * time.Second -var upstreamMessageDelay = 2 * time.Second -var upstreamMessageBurst = 10 -var backlogTimeout = 10 * time.Second -var handleDownstreamMessageTimeout = 10 * time.Second -var downstreamRegisterTimeout = 30 * time.Second -var webpushCheckSubscriptionDelay = 24 * time.Hour -var webpushPruneSubscriptionDelay = 30 * 24 * time.Hour -var chatHistoryLimit = 1000 -var backlogLimit = 4000 +var ( + retryConnectMinDelay = time.Minute + retryConnectMaxDelay = 10 * time.Minute + retryConnectJitter = time.Minute + connectTimeout = 15 * time.Second + writeTimeout = 10 * time.Second + upstreamMessageDelay = 2 * time.Second + upstreamMessageBurst = 10 + backlogTimeout = 10 * time.Second + handleDownstreamMessageTimeout = 10 * time.Second + downstreamRegisterTimeout = 30 * time.Second + webpushCheckSubscriptionDelay = 24 * time.Hour + webpushPruneSubscriptionDelay = 30 * 24 * time.Hour + chatHistoryLimit = 1000 + backlogLimit = 4000 +) var errWebPushSubscriptionExpired = fmt.Errorf("Web Push subscription expired") -- 2.45.2