Skip to content

Commit

Permalink
Fix: Improve log levels for max queue size and channel not found (#12)
Browse files Browse the repository at this point in the history
Closes #6
  • Loading branch information
ani1311 committed Oct 22, 2023
1 parent 85c6a35 commit da87622
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit da87622

Please sign in to comment.