diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-07 19:42:36 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-07 19:42:36 +0100 |
commit | e546699511510297b1b32f4be1e8a8a7bf0534f4 (patch) | |
tree | c5b8e1610865a2d45a6377d3fe9ad2d6b619f3b6 /src/libutil | |
parent | e90a21c14984d2366d26748167a66cbee2572cbd (diff) | |
download | rspamd-e546699511510297b1b32f4be1e8a8a7bf0534f4.tar.gz rspamd-e546699511510297b1b32f4be1e8a8a7bf0534f4.zip |
[Minor] Download updated data even if cache is still available
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/map.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index 0019aaa90..fad48aeab 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -1095,13 +1095,19 @@ rspamd_map_common_http_callback (struct rspamd_map *map, return; } - else if (rspamd_map_read_cached (map, bk, periodic, data->host)) { - /* Switch to the next backend */ - periodic->cur_backend ++; - data->last_modified = map->cache->last_modified; - rspamd_map_periodic_callback (-1, EV_TIMEOUT, periodic); + else { + if (map->active_http && + data->last_modified > map->cache->last_modified) { + goto check; + } + else if (rspamd_map_read_cached (map, bk, periodic, data->host)) { + /* Switch to the next backend */ + periodic->cur_backend++; + data->last_modified = map->cache->last_modified; + rspamd_map_periodic_callback (-1, EV_TIMEOUT, periodic); - return; + return; + } } } else if (!map->active_http) { |