aboutsummaryrefslogtreecommitdiff
path: root/monitor/monitor.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-03-31 13:10:01 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-01 10:57:03 +0300
commit240ab4c02b546d60bf703ff5907c538d7d7051cd (patch)
tree3f55f299ec3a3c7530eec8fa27198062c537deeb /monitor/monitor.cxx
parent00d025da3fbc001900304544e1b698245232c178 (diff)
Make brep-monitor not to update build delay report timestamps if --report-timeout is unspecified
Diffstat (limited to 'monitor/monitor.cxx')
-rw-r--r--monitor/monitor.cxx36
1 files changed, 22 insertions, 14 deletions
diff --git a/monitor/monitor.cxx b/monitor/monitor.cxx
index 31b2af1..4640409 100644
--- a/monitor/monitor.cxx
+++ b/monitor/monitor.cxx
@@ -509,9 +509,9 @@ namespace brep
{
id = build_id (p->id, c.name, t.first, t.second);
- // If the toolchain version is not specified then search for
- // the latest build across all toolchain versions and search
- // for a specific build otherwise.
+ // If the toolchain version is unspecified then search for the
+ // latest build across all toolchain versions and search for a
+ // specific build otherwise.
//
shared_ptr<build> b;
@@ -592,13 +592,13 @@ namespace brep
else
delayed = (bct == timestamp_nonexistent);
- // If the report timeout is not specified then report the
- // delay unconditionally. Otherwise, report the active package
- // build delay if the report timeout is expired and the
- // archived package build delay if it was never reported. Note
- // that fixing the building infrastructure won't help building
- // an archived package, so reporting its build delays
- // repeatedly is meaningless.
+ // If the report timeout is unspecified then report the delay
+ // unconditionally. Otherwise, report the active package build
+ // delay if the report timeout is expired and the archived
+ // package build delay if it was never reported. Note that
+ // fixing the building infrastructure won't help building an
+ // archived package, so reporting its build delays repeatedly
+ // is meaningless.
//
if (delayed &&
(!ops.report_timeout_specified () ||
@@ -721,12 +721,20 @@ namespace brep
// Persist the delay report timestamps.
//
- transaction t (db.begin ());
+ // If we don't consider the report timestamps for reporting delays, it
+ // seems natural not to update these timestamps either. Note that
+ // reporting all delays and still updating the report timestamps can be
+ // achieved by specifying the zero report timeout.
+ //
+ if (ops.report_timeout_specified ())
+ {
+ transaction t (db.begin ());
- for (shared_ptr<const build_delay> d: delays)
- db.update (d);
+ for (shared_ptr<const build_delay> d: delays)
+ db.update (d);
- t.commit ();
+ t.commit ();
+ }
}
catch (const io_error&)
{