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:
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue