Remove double for loop
@@ -73,7 +73,6 @@ func (w *AppServiceStoreWatcher) Run() {
events, stopChan, errChan := w.adapter.Watch("/loggregator/services")
w.registerExistingServicesFromStore()
- for {
for {
select {
case <-w.done:
@@ -97,15 +96,12 @@ func (w *AppServiceStoreWatcher) Run() {
continue
}
w.Add(appServiceFromStoreNode(event.Node))
- case storeadapter.DeleteEvent:
- w.deleteEvent(event.PrevNode)
- case storeadapter.ExpireEvent:
+ case storeadapter.DeleteEvent, storeadapter.ExpireEvent:
w.deleteEvent(event.PrevNode)
}
}
}
}
-}
func (w *AppServiceStoreWatcher) registerExistingServicesFromStore() {
services, _ := w.adapter.ListRecursively("/loggregator/services/")
