diff --git a/apteryxd.c b/apteryxd.c index 446bbda..ddc77a5 100644 --- a/apteryxd.c +++ b/apteryxd.c @@ -592,6 +592,12 @@ call_refreshers (const char *path, bool dry_run) timeout = cb (cpath); if (refresher->timeout == 0 || timeout < refresher->timeout) refresher->timeout = timeout; + /* Record the last time we ran this refresher */ + refresher->timestamp = now; + /* Record the path we refreshed (without any trailing /'s)*/ + if (refresher->last_path) + free (refresher->last_path); + refresher->last_path = g_strdup (cpath); goto unlock; } diff --git a/config.c b/config.c index 294a896..6379012 100644 --- a/config.c +++ b/config.c @@ -282,7 +282,7 @@ _statistics_fn (gpointer data, gpointer user_data) if (cb->count) avg = (int)(GET_COUNTER(cb->total)/GET_COUNTER(cb->count)); value = g_strdup_printf ("%u,%u,%u,%u", GET_COUNTER(cb->count), GET_COUNTER(cb->min), avg, GET_COUNTER(cb->max)); - db_add (path, (const unsigned char *)value, strlen (value) + 1, get_time_us ()); + db_add (path, (const unsigned char *)value, strlen (value) + 1, UINT64_MAX); g_free (path); g_free (value); }