1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-17 04:30:03 +02:00

transport/redis_pubsub/subscriber.go: make Close() return an error.

This commit is contained in:
Henrik Hautakoski 2023-03-29 15:40:37 +02:00
parent a23661e088
commit 65173425a6

View file

@ -96,8 +96,8 @@ func (s *Subscriber) Read(channel transport.Channel) ([]byte, error) {
return <-ch, nil
}
func (s *Subscriber) Close() {
s.sub.Close()
func (s *Subscriber) Close() error {
err := s.sub.Close()
for _, ch := range s.channels {
close(ch)
@ -105,4 +105,6 @@ func (s *Subscriber) Close() {
s.mu.Lock()
s.channels = make(map[string]chan []byte)
s.mu.Unlock()
return err
}