int rrdtool_update_data(struct rrd_database *rrd)
{
- rrd->last_update = time(0);
+ time_t now = time(0);
+
+ /*
+ * This will put our last update slightly into past, but
+ * ensures our update interval will not drift over time.
+ */
+ rrd->last_update = now - now % rrd->interval;
return queue_work(WORK_PRIORITY_HIGH, "rrdtool_update_data",
(work_fn_t *)do_rrdtool_update_data, rrd);