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:
James Shubin
2016-12-11 23:00:20 -05:00
parent af47511d58
commit 067932aebf
13 changed files with 5 additions and 57 deletions

View File

@@ -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()