fixing some race conditions

This commit is contained in:
2021-12-13 04:33:43 -05:00
parent 851cc327e5
commit 6dba963608
3 changed files with 43 additions and 15 deletions

View File

@@ -30,11 +30,19 @@ func NewCollection(service *Service, path dbus.ObjectPath) (coll *Collection, er
}
// Populate the struct fields...
// TODO: use channel for errors; condense into a MultiError.
go coll.Locked()
go coll.Label()
go coll.Created()
go coll.Modified()
// TODO: use channel for errors; condense into a MultiError and switch to goroutines.
if _, err = coll.Locked(); err != nil {
return
}
if _, err = coll.Label(); err != nil {
return
}
if _, err = coll.Created(); err != nil {
return
}
if _, _, err = coll.Modified(); err != nil {
return
}
return
}