aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-result.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-07-20 21:19:36 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-07-20 21:19:36 +0300
commit58e98949ad3dc27b8261688b99f920d106724252 (patch)
treebcdbe7bf4ad102fd532e266bb838548087a85dd2 /mod/mod-build-result.cxx
parentea6808cc41094b87f667705587fe2deea0437a1e (diff)
Log more info when issue warnings in build-result and build-force handlers
Diffstat (limited to 'mod/mod-build-result.cxx')
-rw-r--r--mod/mod-build-result.cxx16
1 files changed, 13 insertions, 3 deletions
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<build> b;
+
+ auto build_timestamp = [&b] ()
+ {
+ return to_string (
+ chrono::duration_cast<std::chrono::nanoseconds> (
+ b->timestamp.time_since_epoch ()).count ());
+ };
+
if (!build_db_->query_one<package_build> (
query<package_build>::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.