diff options
-rw-r--r-- | gentoobrowse-api/service/maintenanceBugs.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gentoobrowse-api/service/maintenanceBugs.cpp b/gentoobrowse-api/service/maintenanceBugs.cpp index 8c56cec..28c2f20 100644 --- a/gentoobrowse-api/service/maintenanceBugs.cpp +++ b/gentoobrowse-api/service/maintenanceBugs.cpp @@ -13,6 +13,7 @@ #include <lexer.h> #include <lexer-regex.h> #include <utils/dbUtils.h> +#include <compileTimeFormatter.h> namespace Gentoo { namespace Service { @@ -67,12 +68,16 @@ namespace Gentoo { Glib::ustring summary; }; + AdHocFormatter(UpdatingBugs, "Refreshing bug list from %?\n"); + AdHocFormatter(UpdatingBugUrl, " ... %?\n"); + AdHocFormatter(UpdatingBugsResult, "Refreshed bug list: %? added, %? updated, %? removed\n"); void Maintenance::refreshBugs(const Ice::Current & c) { boost::filesystem::path root = properties(c)->getPropertyWithDefault( "GentooBrowseAPI.BugRoot", "https://bugs.gentoo.org/data/cached"); + UpdatingBugs::write(std::cerr, root); auto dbc = db->get(); DB::TransactionScope tx(dbc.get()); DB::TablePatch tp; @@ -86,12 +91,14 @@ namespace Gentoo { "buglist-CONFIRMED.html", "buglist-UNCONFIRMED.html", "buglist-IN_PROGRESS.html" }) { + UpdatingBugUrl::write(std::cerr, bl); AdHoc::Net::CurlStreamSource css((root / bl).string()); css.setopt(CURLOPT_ENCODING, "deflate, gzip"); AdHoc::Net::CurlStream cs(css); blp.parse_stream(cs); } - dbc->patchTable(&tp); + auto result = dbc->patchTable(&tp); + UpdatingBugsResult::write(std::cerr, result.inserts, result.updates, result.deletes); Utils::Database::drop(dbc.get(), tp.src); } } |