summaryrefslogtreecommitdiffstats
path: root/lib/agent/xdsserver.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-15 22:48:35 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-15 23:05:25 +0100
commit89563054ea6305c7270dcc6ab6fa5b286eb5f742 (patch)
tree862e74f361592d38fd3f77ddb4c08276f4db45ee /lib/agent/xdsserver.go
parent9e6fb5106bcb3a0f93a616198ece579c61eb129b (diff)
Fixed xds-server folder events detection.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/xdsserver.go')
-rw-r--r--lib/agent/xdsserver.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/agent/xdsserver.go b/lib/agent/xdsserver.go
index 7020ef0..32656cf 100644
--- a/lib/agent/xdsserver.go
+++ b/lib/agent/xdsserver.go
@@ -307,10 +307,7 @@ func (xs *XdsServer) EventOn(evName string, privData interface{}, f EventCB) (uu
// Register listener only the first time
evn := evName
- // FIXME: use generic type: data interface{} instead of data xsapiv1.EventMsg
- var err error
- if evName == "event:folder-state-change" {
- err = xs.ioSock.On(evn, func(data xsapiv1.EventMsg) error {
+ err := xs.ioSock.On(evn, func(data interface{}) error {
xs.sockEventsLock.Lock()
sEvts := make([]*caller, len(xs.sockEvents[evn]))
copy(sEvts, xs.sockEvents[evn])
@@ -320,18 +317,6 @@ func (xs *XdsServer) EventOn(evName string, privData interface{}, f EventCB) (uu
}
return nil
})
- } else {
- err = xs.ioSock.On(evn, func(data interface{}) error {
- xs.sockEventsLock.Lock()
- sEvts := make([]*caller, len(xs.sockEvents[evn]))
- copy(sEvts, xs.sockEvents[evn])
- xs.sockEventsLock.Unlock()
- for _, c := range sEvts {
- c.Func(c.PrivateData, data)
- }
- return nil
- })
- }
if err != nil {
return uuid.Nil, err
}