From: Tobias Oetiker Date: Tue, 14 Oct 2008 06:37:19 +0000 (+0000) Subject: clearer way of advancing the flush time X-Git-Tag: 1.4.0~258 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=611c51e702c389bc7cf8b1bf36d44d11cc271a65;p=thirdparty%2Frrdtool-1.x.git clearer way of advancing the flush time -- kevin git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1600 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 28912c53..5c47ac1f 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 */