From 46fbd9846a4db1c6cb0ff47a451e6f62a833d296 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 10 Sep 2024 08:56:52 +0300 Subject: [PATCH] fixup redis broker Signed-off-by: Vasiliy Tolstov --- redis.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/redis.go b/redis.go index b7767d4..d2b03f8 100644 --- a/redis.go +++ b/redis.go @@ -230,14 +230,13 @@ func (b *Broker) Subscribe(ctx context.Context, topic string, handler broker.Han done: make(chan struct{}), } - // Run the receiver routine. - go s.loop() - s.sub = b.cli.Subscribe(s.ctx, s.topic) if err := s.sub.Ping(ctx, ""); err != nil { return nil, err } + go s.loop() + return s, nil }