diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-03-31 16:34:03 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-04-01 10:43:05 +0300 |
commit | 00d025da3fbc001900304544e1b698245232c178 (patch) | |
tree | 6a5b6befc94d979050d8b0dff9a3f7f1a0d1c5f7 /monitor | |
parent | 35359f038f571dc46de3d14af72a2bc911fb0a24 (diff) |
Fix brep-monitor not to erroneously report delay due to incomplete rebuild with new toolchain
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/monitor.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/monitor/monitor.cxx b/monitor/monitor.cxx index e04c5e1..31b2af1 100644 --- a/monitor/monitor.cxx +++ b/monitor/monitor.cxx @@ -447,8 +447,9 @@ namespace brep // Prepare the package build prepared query. // // This query will only be used for toolchains that have no version - // specified on the command line to obtain the latest build across all - // toolchain versions. + // specified on the command line to obtain the latest completed build + // across all toolchain versions, if present, and the latest incomplete + // build otherwise. // using bquery = query<package_build>; using prep_bquery = prepared_query<package_build>; @@ -456,10 +457,13 @@ namespace brep build_id id; const auto& bid (bquery::build::id); - bquery bq ((equal<package_build> (bid.package, id.package) && - bid.configuration == bquery::_ref (id.configuration) && + bquery bq ((equal<package_build> (bid.package, id.package) && + bid.configuration == bquery::_ref (id.configuration) && bid.toolchain_name == bquery::_ref (id.toolchain_name)) + - "ORDER BY" + bquery::build::timestamp + "DESC" + "LIMIT 1"); + "ORDER BY" + + bquery::build::completion_timestamp + "DESC, " + + bquery::build::timestamp + "DESC" + + "LIMIT 1"); prep_bquery pbq ( conn->prepare_query<package_build> ("package-build-query", bq)); |