mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
transport/redis_pubsub/subscriber.go: make Close() return an error.
This commit is contained in:
parent
a23661e088
commit
65173425a6
1 changed files with 4 additions and 2 deletions
|
|
@ -96,8 +96,8 @@ func (s *Subscriber) Read(channel transport.Channel) ([]byte, error) {
|
||||||
return <-ch, nil
|
return <-ch, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Subscriber) Close() {
|
func (s *Subscriber) Close() error {
|
||||||
s.sub.Close()
|
err := s.sub.Close()
|
||||||
|
|
||||||
for _, ch := range s.channels {
|
for _, ch := range s.channels {
|
||||||
close(ch)
|
close(ch)
|
||||||
|
|
@ -105,4 +105,6 @@ func (s *Subscriber) Close() {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
s.channels = make(map[string]chan []byte)
|
s.channels = make(map[string]chan []byte)
|
||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue