diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-11-05 15:02:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-11-05 15:02:46 +0000 |
commit | 8b7d8532b3b373203f9643048e0c41defe99e2df (patch) | |
tree | f9bcb3cd8a342ed8416c01e2e4d73b31987dbd2f | |
parent | 7c63add10c03134013fc186a5ac49cdb2d22eca2 (diff) | |
download | rspamd-8b7d8532b3b373203f9643048e0c41defe99e2df.tar.gz rspamd-8b7d8532b3b373203f9643048e0c41defe99e2df.zip |
[Minor] Add check for map cache skew
-rw-r--r-- | src/libserver/maps/map.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c index 079ca1cc9..14792753a 100644 --- a/src/libserver/maps/map.c +++ b/src/libserver/maps/map.c @@ -263,6 +263,14 @@ rspamd_map_cache_cb (struct ev_loop *loop, ev_timer *w, int revents) w->repeat = cache_cbd->map->poll_timeout; } + if (w->repeat < 0) { + msg_info_map ("cached data for %s has skewed check time: %d last checked, %d poll timeout, %.2f diff", + map->name, (int)cache_cbd->data->last_checked, + (int)cache_cbd->map->poll_timeout, + (rspamd_get_calendar_ticks () - cache_cbd->data->last_checked)); + w->repeat = 0.0; + } + cache_cbd->last_checked = cache_cbd->data->last_checked; msg_debug_map ("cached data is up to date for %s", map->name); ev_timer_again (loop, &cache_cbd->timeout); |