From 6d4bab7f21c3661dd4dd5a0de7e097b1de3f642c Mon Sep 17 00:00:00 2001 From: Alexey Kondratov Date: Mon, 9 Nov 2020 19:24:55 +0300 Subject: [PATCH v1 3/3] pg_prewarm: refactor autoprewarm waits Previously it was dumping twice at every timeout time. --- contrib/pg_prewarm/autoprewarm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c index b18a065ed5..f52c83de1e 100644 --- a/contrib/pg_prewarm/autoprewarm.c +++ b/contrib/pg_prewarm/autoprewarm.c @@ -238,7 +238,9 @@ autoprewarm_main(Datum main_arg) { last_dump_time = GetCurrentTimestamp(); apw_dump_now(true, false); - continue; + + /* We have to sleep even after a successfull dump */ + delay_in_ms = autoprewarm_interval * 1000; } /* Sleep until the next dump time. */ -- 2.19.1