Initialize subscriber channel on open

If the subscriber service was closed and re-open, it would panic
with panic: send on closed channel
pull/6833/head
Jason Wilder 2016-06-10 18:00:44 -06:00
parent 256f57a4f4
commit ab4d21804c
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,6 @@ func NewService(c Config) *Service {
s := &Service{
Logger: log.New(os.Stderr, "[subscriber] ", log.LstdFlags),
statMap: influxdb.NewStatistics("subscriber", "subscriber", nil),
points: make(chan *coordinator.WritePointsRequest, 100),
closed: true,
conf: c,
failures: &expvar.Int{},
@ -88,6 +87,7 @@ func (s *Service) Open() error {
s.closing = make(chan struct{})
s.update = make(chan struct{})
s.points = make(chan *coordinator.WritePointsRequest, 100)
s.wg.Add(2)
go func() {