resources: Remove SetWatching/IsWatching code from Watch
This removes some boilerplate from the Watch methods which can be baked into the engine instead. This code should be checked for races and locks to make sure we only start resources when it makes sense to.
This commit is contained in:
@@ -109,11 +109,6 @@ func (obj *PkgRes) Validate() error {
|
||||
// TODO: https://github.com/hughsie/PackageKit/issues/109
|
||||
// TODO: https://github.com/hughsie/PackageKit/issues/110
|
||||
func (obj *PkgRes) Watch(processChan chan event.Event) error {
|
||||
if obj.IsWatching() {
|
||||
return nil
|
||||
}
|
||||
obj.SetWatching(true)
|
||||
defer obj.SetWatching(false)
|
||||
cuid := obj.Converger() // get the converger uid used to report status
|
||||
|
||||
bus := packagekit.NewBus()
|
||||
|
||||
Reference in New Issue
Block a user