diff options
Diffstat (limited to 'gentoobrowse-api/util/update.cpp')
-rw-r--r-- | gentoobrowse-api/util/update.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gentoobrowse-api/util/update.cpp b/gentoobrowse-api/util/update.cpp index f14df6e..4c4b1dd 100644 --- a/gentoobrowse-api/util/update.cpp +++ b/gentoobrowse-api/util/update.cpp @@ -30,22 +30,19 @@ main(int c, char ** v) } auto ic = Ice::initialize(c, v); - auto m = Gentoo::MaintenancePrx::checkedCast(ic->stringToProxy("maintenance:" + endpoint)); + auto m = Ice::checkedCast<Gentoo::MaintenancePrx>(ic->stringToProxy("maintenance:" + endpoint)); m->ice_ping(); - std::set<Ice::AsyncResultPtr> jobs; - if (bugs) jobs.insert(m->begin_refreshBugs()); + std::vector<std::future<void>> jobs; + if (bugs) jobs.push_back(m->refreshBugsAsync()); if (pull) m->updateRepositories(); - if (tree) jobs.insert(m->begin_refreshPackageTree()); - - std::for_each(jobs.begin(), jobs.end(), [](const auto & j) { j->waitForSent(); }); + if (tree) jobs.push_back(m->refreshPackageTreeAsync()); int failures = 0; if (!background) { - std::for_each(jobs.begin(), jobs.end(), [&failures](const auto & j) { + std::for_each(jobs.begin(), jobs.end(), [&failures](auto & f) { try { - j->waitForCompleted(); - j->throwLocalException(); + f.get(); } catch (const std::exception & ex) { failures += 1; |