Packages: check for existing update when scheduling
This is fixing an issue identified in the launcher in a secondary way, to ensure if another user of the API tries to schedule an already scheduled package, we ignore the second request.
This commit is contained in:
@@ -595,6 +595,12 @@ void Root::scheduleToUpdate(InstallRef aInstall)
|
|||||||
throw sg_exception("missing argument to scheduleToUpdate");
|
throw sg_exception("missing argument to scheduleToUpdate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto it = std::find(d->updateDeque.begin(), d->updateDeque.end(), aInstall);
|
||||||
|
if (it != d->updateDeque.end()) {
|
||||||
|
// already scheduled to update
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PackageList deps = aInstall->package()->dependencies();
|
PackageList deps = aInstall->package()->dependencies();
|
||||||
for (Package* dep : deps) {
|
for (Package* dep : deps) {
|
||||||
// will internally schedule for update if required
|
// will internally schedule for update if required
|
||||||
|
|||||||
Reference in New Issue
Block a user