Skip to content

Commit

Permalink
[Fix] Fix cached maps logic
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed May 17, 2018
1 parent 1f6ae62 commit 24bc729
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libutil/map.c
Expand Up @@ -346,11 +346,11 @@ rspamd_map_cache_cb (gint fd, short what, gpointer ud)
/* We have another update, so this cache element is obviously expired */
/* Important: we do not set cache availability to zero here */
MAP_RELEASE (cache_cbd->shm, "rspamd_http_map_cached_cbdata");
msg_debug_map ("cached data is now expired (gen mismatch) for %s", map->name);
msg_info_map ("cached data is now expired (gen mismatch) for %s", map->name);
event_del (&cache_cbd->timeout);
g_free (cache_cbd);
}
else if (cache_cbd->data->last_checked > cache_cbd->last_checked) {
else if (cache_cbd->data->last_checked >= cache_cbd->last_checked) {
/*
* We checked map but we have not found anything more recent,
* reschedule cache check
Expand All @@ -363,7 +363,7 @@ rspamd_map_cache_cb (gint fd, short what, gpointer ud)
else {
g_atomic_int_set (&map->cache->available, 0);
MAP_RELEASE (cache_cbd->shm, "rspamd_http_map_cached_cbdata");
msg_debug_map ("cached data is now expired for %s", map->name);
msg_info_map ("cached data is now expired for %s", map->name);
event_del (&cache_cbd->timeout);
g_free (cache_cbd);
}
Expand Down

0 comments on commit 24bc729

Please sign in to comment.