[rrd-developers] [PATCH] clearer way of advancing the flush time

kevin brintnall kbrint at rufus.net
Tue Oct 14 00:11:19 CEST 2008


---
 src/rrd_daemon.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c
index 28912c5..5c47ac1 100644
--- a/src/rrd_daemon.c
+++ b/src/rrd_daemon.c
@@ -748,8 +748,8 @@ static void *queue_thread_main (void *args __attribute__((unused))) /* {{{ */
       flush_old_values (config_write_interval);
 
       /* Determine the time of the next cache flush. */
-      while (next_flush.tv_sec <= now.tv_sec)
-        next_flush.tv_sec += config_flush_interval;
+      next_flush.tv_sec =
+        now.tv_sec + next_flush.tv_sec % config_flush_interval;
 
       /* unlock the cache while we rotate so we don't block incoming
        * updates if the fsync() blocks on disk I/O */
-- 
1.6.0.2



More information about the rrd-developers mailing list