X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_daemon.c;h=2a35ec2abe59cfc2f87a316a0e097c051879a98d;hp=36701f892ffedea1533c87f32c6a4925c9e641ef;hb=ff4657f155a7acb054aaa702a7c2f610991bd0e9;hpb=d6493e16d7f4f452e9f2fdccfc84000143171ddb diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 36701f8..2a35ec2 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -820,14 +820,15 @@ static void *flush_thread_main (void *args __attribute__((unused))) /* {{{ */ || ((now.tv_sec == next_flush.tv_sec) && ((1000 * now.tv_usec) > next_flush.tv_nsec))) { + RRDD_LOG(LOG_DEBUG, "flushing old values"); + + /* Determine the time of the next cache flush. */ + next_flush.tv_sec = now.tv_sec + config_flush_interval; + /* Flush all values that haven't been written in the last * `config_write_interval' seconds. */ flush_old_values (config_write_interval); - /* Determine the time of the next cache flush. */ - 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 */ pthread_mutex_unlock(&cache_lock);