File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,8 @@ func (d *DiscoveryServer) startSync() {
231231 d .outputError ("start_sync" , "Discovery already STARTed, cannot START_SYNC" )
232232 return
233233 }
234- d .syncChannel = make (chan interface {}, 10 ) // buffer up to 10 events
234+ c := make (chan interface {}, 10 ) // buffer up to 10 events
235+ d .syncChannel = c
235236 if err := d .impl .StartSync (d .syncEvent ); err != nil {
236237 d .outputError ("start_sync" , "Cannot START_SYNC: " + err .Error ())
237238 close (d .syncChannel ) // do not leak channel...
@@ -240,13 +241,12 @@ func (d *DiscoveryServer) startSync() {
240241 }
241242 d .syncStarted = true
242243 d .outputOk ("start_sync" )
243- go d .consumeEvents (d .syncChannel )
244- }
245244
246- func (d * DiscoveryServer ) consumeEvents (c <- chan interface {}) {
247- for e := range c {
248- d .output (e )
249- }
245+ go func () {
246+ for e := range c {
247+ d .output (e )
248+ }
249+ }()
250250}
251251
252252func (d * DiscoveryServer ) stop () {
You can’t perform that action at this time.
0 commit comments