Don't bother reporting job durations less than 10s.
authorCarl Hetherington <cth@carlh.net>
Fri, 25 Aug 2023 23:32:13 +0000 (01:32 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 25 Aug 2023 23:32:13 +0000 (01:32 +0200)
src/lib/job.cc

index e37ca2aab91eb53d1f084b0d12b8a1bcee9ea20a..811e4c983672f27fb4a996280aacb86d3916ada9 100644 (file)
@@ -595,7 +595,10 @@ Job::status () const
                        return string(buffer);
                };
                auto const duration = _finish_time - _start_time;
-               if (duration < 600) {
+               if (duration < 10) {
+                       /* It took less than 10 seconds; it doesn't seem worth saying how long it took */
+                       s = _("OK");
+               } else if (duration < 600) {
                        /* It took less than 10 minutes; it doesn't seem worth saying when it started and finished */
                        s = String::compose(_("OK (ran for %1)"), seconds_to_hms(duration));
                } else {