From 58e98949ad3dc27b8261688b99f920d106724252 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 20 Jul 2023 21:19:36 +0300 Subject: Log more info when issue warnings in build-result and build-force handlers --- mod/mod-build-result.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'mod/mod-build-result.cxx') diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx index 533921b..3e54d12 100644 --- a/mod/mod-build-result.cxx +++ b/mod/mod-build-result.cxx @@ -201,6 +201,14 @@ handle (request& rq, response&) package_build pb; shared_ptr b; + + auto build_timestamp = [&b] () + { + return to_string ( + chrono::duration_cast ( + b->timestamp.time_since_epoch ()).count ()); + }; + if (!build_db_->query_one ( query::build::id == id, pb)) { @@ -208,11 +216,13 @@ handle (request& rq, response&) } else if ((b = move (pb.build))->state != build_state::building) { - warn_expired ("package configuration state is " + to_string (b->state)); + warn_expired ("package configuration state is " + to_string (b->state) + + ", force state " + to_string (b->force) + + ", timestamp " + build_timestamp ()); } else if (b->timestamp != session.timestamp) { - warn_expired ("non-matching timestamp"); + warn_expired ("non-matching timestamp " + build_timestamp ()); } else if (authenticate_session (*options_, rqm.challenge, *b, rqm.session)) { @@ -303,7 +313,7 @@ handle (request& rq, response&) "dependency"); } - unforced = b->force == force_state::unforced; + unforced = (b->force == force_state::unforced); // Don't send email to the build-email address for the // success-to-success status change, unless the build was forced. -- cgit v1.1