From da87622d73f38b488b11cff43d10ecfc54bc5d71 Mon Sep 17 00:00:00 2001 From: ani1311 <31389826+ani1311@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:27:25 -0700 Subject: [PATCH] Fix: Improve log levels for max queue size and channel not found (#12) Closes #6 --- app.go | 2 +- server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index 90ae81e..73f837c 100644 --- a/app.go +++ b/app.go @@ -211,7 +211,7 @@ func (app *App) processQueue(ctx context.Context, maxRetries int, initialBackoff retryable, pause, description := CheckError(err.Error(), msg.Channel) if pause { - log.S(log.Info, "Channel not found, pausing for 15 minutes", log.String("channel", msg.Channel)) + log.S(log.Warning, "Channel not found, pausing for 15 minutes", log.String("channel", msg.Channel)) app.metrics.RequestsNotProcessed.WithLabelValues(msg.Channel).Inc() break } diff --git a/server.go b/server.go index 5b609fc..b16ff16 100644 --- a/server.go +++ b/server.go @@ -57,7 +57,7 @@ func (app *App) handleRequest(w http.ResponseWriter, r *http.Request) { // Ideally we don't reject at 90%, but initially after some tests I got blocked. So I decided to be a bit more conservative. // ToDo: Fix this behavior so we can reach 100% channel size without problems. if len(app.slackQueue) >= maxQueueSize { - log.S(log.Info, "Queue is almost full, returning StatusServiceUnavailable", log.Int("queueSize", len(app.slackQueue))) + log.S(log.Warning, "Queue is almost full, returning StatusServiceUnavailable", log.Int("queueSize", len(app.slackQueue))) err := jrpc.Reply[SlackResponse](w, http.StatusServiceUnavailable, &SlackResponse{ Ok: false,