From fc6f5ddf35c42c809a2bc57e562134f747df9d29 Mon Sep 17 00:00:00 2001 From: biast12 <53872542+biast12@users.noreply.github.com> Date: Thu, 1 Oct 2026 20:07:10 +0200 Subject: [PATCH] Make Redis stream max length configurable Use the configured `STREAMS_MAX_LEN` value when creating the worker event stream instead of hardcoding a 50,000-entry limit. --- cmd/worker/main.go | 2 +- config/config.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/worker/main.go b/cmd/worker/main.go index 4116ef71..309bae9f 100644 --- a/cmd/worker/main.go +++ b/cmd/worker/main.go @@ -252,7 +252,7 @@ func main() { ConsumerGroup: "worker", ConsumerName: hostname, ConsumerConcurrency: config.Conf.Streams.GoroutineLimit, - MaxLen: 50000, + MaxLen: config.Conf.Streams.MaxLen, }, map[string]rpc.Listener{ "stream:gateway-events": event.NewEventListener( diff --git a/config/config.go b/config/config.go index 5b3298ce..50913d02 100644 --- a/config/config.go +++ b/config/config.go @@ -87,7 +87,8 @@ type ( } `envPrefix:"WORKER_REDIS_"` Streams struct { - GoroutineLimit int `env:"STREAMS_GOROUTINE_LIMIT" envDefault:"1000"` + GoroutineLimit int `env:"STREAMS_GOROUTINE_LIMIT" envDefault:"1000"` + MaxLen int64 `env:"STREAMS_MAX_LEN" envDefault:"50000"` } Prometheus struct {