diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-05-07 16:24:51 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-05-07 16:24:51 +0100 |
commit | 4ce4a989e704452063d24c544ebecd9cf6478bee (patch) | |
tree | 0fb4484b26e19965fd57bae0e53006b5402deb4e | |
parent | Use raw string for readability (diff) | |
download | gentoobrowse-api-4ce4a989e704452063d24c544ebecd9cf6478bee.tar.bz2 gentoobrowse-api-4ce4a989e704452063d24c544ebecd9cf6478bee.tar.xz gentoobrowse-api-4ce4a989e704452063d24c544ebecd9cf6478bee.zip |
Add logging of bug refresh progress
-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); } } |