From 4ce4a989e704452063d24c544ebecd9cf6478bee Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 7 May 2017 16:24:51 +0100 Subject: Add logging of bug refresh progress --- gentoobrowse-api/service/maintenanceBugs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 #include #include +#include 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); } } -- cgit v1.2.3