]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Another heartbeat race
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 Sep 2019 15:28:49 +0000 (16:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 Sep 2019 15:28:49 +0000 (16:28 +0100)
src/libserver/worker_util.c

index f6fef8df52212017abcba4ef0730467d4006a707..58d75da5d706c0454307317f901f4c1f48486599 100644 (file)
@@ -722,7 +722,8 @@ rspamd_main_heartbeat_cb (EV_P_ ev_timer *w, int revents)
        time_from_last -= wrk->hb.last_event;
        rspamd_main = wrk->srv;
 
-       if (time_from_last > 0 &&
+       if (wrk->hb.last_event > 0 &&
+               time_from_last > 0 &&
                time_from_last >= rspamd_main->cfg->heartbeat_interval * 2) {
 
                rspamd_localtime (wrk->hb.last_event, &tm);