diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-03 12:34:11 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-03 12:34:11 +0000 |
commit | 46f91e3e37f7e698e6070e5ef337e3dc1142a804 (patch) | |
tree | 69176c507e0ec8a64dc6bf1baa72d4d775e9ca5f | |
parent | f6c7e98b74e08074670eaa8515bc63f222e7760a (diff) | |
download | rspamd-46f91e3e37f7e698e6070e5ef337e3dc1142a804.tar.gz rspamd-46f91e3e37f7e698e6070e5ef337e3dc1142a804.zip |
[Fix] Do not resort cache on each check
-rw-r--r-- | src/libserver/symbols_cache.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 42232b9ec..5b532b979 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -357,8 +357,7 @@ rspamd_symbols_cache_resort (struct symbols_cache *cache) it = g_ptr_array_index (cache->items_by_id, i); total_hits += it->st->total_hits; - if (!(it->type & (SYMBOL_TYPE_PREFILTER|SYMBOL_TYPE_POSTFILTER - |SYMBOL_TYPE_COMPOSITE|SYMBOL_TYPE_CLASSIFIER))) { + if (!(it->type & (SYMBOL_TYPE_PREFILTER|SYMBOL_TYPE_POSTFILTER|SYMBOL_TYPE_COMPOSITE))) { g_ptr_array_add (ord->d, it); } } @@ -1656,6 +1655,10 @@ rspamd_symbols_cache_process_symbols (struct rspamd_task * task, for (i = 0; i < (gint)checkpoint->version; i ++) { item = g_ptr_array_index (checkpoint->order->d, i); + if (item->type & SYMBOL_TYPE_CLASSIFIER) { + continue; + } + if (!(item->type & SYMBOL_TYPE_FINE) && rspamd_session_events_pending (task->s) == 0) { if (rspamd_symbols_cache_metric_limit (task, checkpoint)) { |