Skip to content

Commit dbddfc2

Browse files
committed
scratch-buffers: use timeutils/cache instead of iv_now
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
1 parent 79cf9b4 commit dbddfc2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/scratch-buffers.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,16 @@ _thread_maintenance_period_elapsed(void)
230230
if (!scratch_buffers_time_of_last_maintenance)
231231
return TRUE;
232232

233-
iv_validate_now();
234-
if (scratch_buffers_time_of_last_maintenance - iv_now.tv_sec >= SCRATCH_BUFFERS_MAINTENANCE_PERIOD)
233+
time_t now = get_cached_realtime_sec();
234+
if (scratch_buffers_time_of_last_maintenance - now >= SCRATCH_BUFFERS_MAINTENANCE_PERIOD)
235235
return TRUE;
236236
return FALSE;
237237
}
238238

239239
static void
240240
_thread_maintenance_update_time(void)
241241
{
242-
scratch_buffers_time_of_last_maintenance = iv_now.tv_sec;
242+
scratch_buffers_time_of_last_maintenance = get_cached_realtime_sec();
243243
}
244244

245245
void

0 commit comments

Comments
 (0)