Remove Unused Map
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
c864bccbb9
commit
b33c6c77dd
|
@ -23,11 +23,10 @@ type EventHandler struct {
|
||||||
app app.Application
|
app app.Application
|
||||||
appBusQueue event.Queue
|
appBusQueue event.Queue
|
||||||
profileEvents chan EventProfileEnvelope
|
profileEvents chan EventProfileEnvelope
|
||||||
profileQueues map[string]event.Queue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewEventHandler() *EventHandler {
|
func NewEventHandler() *EventHandler {
|
||||||
eh := &EventHandler{app: nil, appBusQueue: event.NewQueue(), profileQueues: make(map[string]event.Queue), profileEvents: make(chan EventProfileEnvelope)}
|
eh := &EventHandler{app: nil, appBusQueue: event.NewQueue(), profileEvents: make(chan EventProfileEnvelope)}
|
||||||
return eh
|
return eh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,7 +344,6 @@ func (eh *EventHandler) startHandlingPeer(onion string) {
|
||||||
eventBus.Subscribe(event.ChangePasswordError, q)
|
eventBus.Subscribe(event.ChangePasswordError, q)
|
||||||
eventBus.Subscribe(event.NewRetValMessageFromPeer, q)
|
eventBus.Subscribe(event.NewRetValMessageFromPeer, q)
|
||||||
eventBus.Subscribe(event.SetAttribute, q)
|
eventBus.Subscribe(event.SetAttribute, q)
|
||||||
eh.profileQueues[onion] = q
|
|
||||||
|
|
||||||
go eh.forwardProfileMessages(onion, q)
|
go eh.forwardProfileMessages(onion, q)
|
||||||
|
|
||||||
|
@ -357,6 +355,9 @@ func (eh *EventHandler) forwardProfileMessages(onion string, q event.Queue) {
|
||||||
e := q.Next()
|
e := q.Next()
|
||||||
ev := EventProfileEnvelope{Event: e, Profile: onion}
|
ev := EventProfileEnvelope{Event: e, Profile: onion}
|
||||||
eh.profileEvents <- ev
|
eh.profileEvents <- ev
|
||||||
|
if ev.Event.EventType == event.Shutdown {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue