X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fagent%2Fprojects.go;h=7393364fa88be7d06140ceff63d642c9264d549c;hb=45f6472d1e8ecad428da314a6d762143f033865d;hp=a2d8fe123fc36f9c8caa1979322f9979c6153456;hpb=d0d64817590d38d182faeb0e040861d3d3cb9f3b;p=src%2Fxds%2Fxds-agent.git diff --git a/lib/agent/projects.go b/lib/agent/projects.go index a2d8fe1..7393364 100644 --- a/lib/agent/projects.go +++ b/lib/agent/projects.go @@ -75,6 +75,11 @@ func (p *Projects) Init(server *XdsServer) error { for _, prj := range xFlds { newP := svr.FolderToProject(prj) if _, err := p.createUpdate(newP, false, true); err != nil { + // Don't consider that as an error (allow support config without CloudSync support) + if p.Context.SThg == nil && strings.Contains(err.Error(), "Server doesn't support project type CloudSync") { + continue + } + errMsg += "Error while creating project id " + prj.ID + ": " + err.Error() + "\n " continue } @@ -246,14 +251,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 }