]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Write Open Telemetry plugin: Improve readability of time comparison.
authorFlorian Forster <ff@octo.it>
Wed, 3 Jan 2024 15:37:48 +0000 (16:37 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 3 Jan 2024 16:16:28 +0000 (17:16 +0100)
Co-authored-by: Eero Tamminen <eero.t.tamminen@intel.com>
src/write_open_telemetry.cc

index f2db6e938dab517adb1418d03a896cdc4b607eff..34096f68d173a149cb8a6349b65e56e21db50fe1 100644 (file)
@@ -130,7 +130,7 @@ static int ot_flush_nolock(cdtime_t timeout, ot_callback_t *cb) {
   /* timeout == 0  => flush unconditionally */
   if (timeout > 0) {
     cdtime_t now = cdtime();
-    if ((cb->staged_time + timeout) > now)
+    if (now < (cb->staged_time + timeout))
       return 0;
   }