Move the pkg update routine in SysAdm to the pkg queue in the dispatcher so that it does not conflict with other possible pkg commands that get started soon after.

This commit is contained in:
Ken Moore
2017-04-28 09:40:38 -04:00
parent 4fe277350a
commit dfb6e1b6a6

View File

@@ -343,7 +343,8 @@ QJsonArray PKG::list_repos(bool updated){
}
if(found.length()<2 && !updated){
//Only the local repo could be found - update the package repos and try again
QProcess::execute("pkg update");
DProcess* proc = DISPATCHER->queueProcess(Dispatcher::PKG_QUEUE, "internal_sysadm_pkg_repo_update_sync", "pkg update");
proc->waitForFinished();
return list_repos(true); //try again recursively (will not try to update again)
}
return QJsonArray::fromStringList(found);