diff options
Diffstat (limited to 'contrib/pg_prewarm/autoprewarm.c')
-rw-r--r-- | contrib/pg_prewarm/autoprewarm.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c index 3bd0010bf8b..fcbdbdd0279 100644 --- a/contrib/pg_prewarm/autoprewarm.c +++ b/contrib/pg_prewarm/autoprewarm.c @@ -226,18 +226,16 @@ autoprewarm_main(Datum main_arg) } else { - long delay_in_ms = 0; - TimestampTz next_dump_time = 0; - long secs = 0; - int usecs = 0; + TimestampTz next_dump_time; + long delay_in_ms; /* Compute the next dump time. */ next_dump_time = TimestampTzPlusMilliseconds(last_dump_time, autoprewarm_interval * 1000); - TimestampDifference(GetCurrentTimestamp(), next_dump_time, - &secs, &usecs); - delay_in_ms = secs + (usecs / 1000); + delay_in_ms = + TimestampDifferenceMilliseconds(GetCurrentTimestamp(), + next_dump_time); /* Perform a dump if it's time. */ if (delay_in_ms <= 0) |