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
}
// 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
}