summaryrefslogtreecommitdiffstats
path: root/lib/agent/projects.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/projects.go
parent9e6fb5106bcb3a0f93a616198ece579c61eb129b (diff)
Fixed xds-server folder events detection.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/projects.go')
-rw-r--r--lib/agent/projects.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/agent/projects.go b/lib/agent/projects.go
index a2d8fe1..d6268fa 100644
--- a/lib/agent/projects.go
+++ b/lib/agent/projects.go
@@ -246,14 +246,12 @@ func (p *Projects) createUpdate(newF xaapiv1.ProjectConfig, create bool, initial
// Add to folders list
p.projects[newPrj.ID] = &fld
- // Force sync after creation
+ // Force sync to get an initial sync status
// (need to defer to be sure that WS events will arrive after HTTP creation reply)
- if create {
- go func() {
- time.Sleep(time.Millisecond * 500)
- fld.Sync()
- }()
- }
+ go func() {
+ time.Sleep(time.Millisecond * 500)
+ fld.Sync()
+ }()
return newPrj, nil
}