diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-14 13:00:03 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-14 13:00:03 +0100 |
commit | e1955662ec5a6d1b3b6b3d939d7d9be9346aa87d (patch) | |
tree | 4a3fdb1f4b295d9756343ca5fefd0c0c4d44588d /src | |
parent | 7fd590aabff817d200a3946872c8d0938e55814f (diff) | |
download | rspamd-e1955662ec5a6d1b3b6b3d939d7d9be9346aa87d.tar.gz rspamd-e1955662ec5a6d1b3b6b3d939d7d9be9346aa87d.zip |
[Fix] Fix periodic scheduling when a map is not modified
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/map.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index 9bf6e5760..11d760fe5 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -475,6 +475,9 @@ http_map_finish (struct rspamd_http_connection *conn, else { cbd->data->last_checked = msg->date; } + + cbd->periodic->cur_backend ++; + rspamd_map_periodic_callback (-1, EV_TIMEOUT, cbd->periodic); } else { msg_info_map ("cannot load map %s from %s: HTTP error %d", @@ -566,6 +569,11 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data, static void rspamd_map_periodic_dtor (struct map_periodic_cbdata *periodic) { + struct rspamd_map *map; + + map = periodic->map; + msg_debug_map ("periodic dtor %p", periodic); + if (periodic->need_modify) { /* We are done */ periodic->map->fin_callback (&periodic->cbdata); @@ -610,6 +618,8 @@ rspamd_map_schedule_periodic (struct rspamd_map *map, cbd->map = map; REF_INIT_RETAIN (cbd, rspamd_map_periodic_dtor); + msg_debug_map ("schedule new periodic event %p in %.2f seconds", cbd, timeout); + if (initial) { evtimer_set (&map->ev, rspamd_map_periodic_callback, cbd); event_base_set (map->ev_base, &map->ev); |