Skip to content

Commit

Permalink
scratch-buffers: use timeutils/cache instead of iv_now
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
  • Loading branch information
bazsi committed Dec 2, 2024
1 parent 1db315a commit 2c30b3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/scratch-buffers.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,16 @@ _thread_maintenance_period_elapsed(void)
if (!scratch_buffers_time_of_last_maintenance)
return TRUE;

iv_validate_now();
if (scratch_buffers_time_of_last_maintenance - iv_now.tv_sec >= SCRATCH_BUFFERS_MAINTENANCE_PERIOD)
time_t now = get_cached_realtime_sec();
if (scratch_buffers_time_of_last_maintenance - now >= SCRATCH_BUFFERS_MAINTENANCE_PERIOD)
return TRUE;
return FALSE;
}

static void
_thread_maintenance_update_time(void)
{
scratch_buffers_time_of_last_maintenance = iv_now.tv_sec;
scratch_buffers_time_of_last_maintenance = get_cached_realtime_sec();
}

void
Expand Down

0 comments on commit 2c30b3f

Please sign in to comment.