Skip to content

Commit

Permalink
Remove errCh (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohkinozomu authored Nov 21, 2023
1 parent bdcf060 commit 3a4fbaa
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/hub/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ type server struct {
payloadCh chan []byte
mergeCh chan mergeChPayload
busCh chan busChPayload
errCh chan error
}

func newClient(c HubConfig, payloadCh chan []byte) *autopaho.ConnectionManager {
Expand Down Expand Up @@ -175,7 +174,6 @@ func newServer(c HubConfig) server {
payloadCh := make(chan []byte, 1000)
mergeCh := make(chan mergeChPayload, 1000)
busCh := make(chan busChPayload, 1000)
errCh := make(chan error, 1000)
client := newClient(c, payloadCh)

if c.CommonConfigV2.Telemetry.Enabled {
Expand Down Expand Up @@ -253,7 +251,6 @@ func newServer(c HubConfig) server {
payloadCh: payloadCh,
mergeCh: mergeCh,
busCh: busCh,
errCh: errCh,
}
}

Expand Down Expand Up @@ -305,7 +302,7 @@ func (s *server) handleRequest(w http.ResponseWriter, r *http.Request) {
},
})
if err != nil {
s.errCh <- err
s.logger.Error("Error subscribing to response topic", zap.Error(err))
return
}
defer s.client.Unsubscribe(ctx, &paho.Unsubscribe{
Expand Down Expand Up @@ -558,8 +555,6 @@ func (s *server) startHTTP1(c HubConfig) {
return
}
}()
case err := <-s.errCh:
s.logger.Info("Error: " + err.Error())
}
}
}()
Expand Down

0 comments on commit 3a4fbaa

Please sign in to comment.