]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not resort cache on each check
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Mar 2017 12:34:11 +0000 (12:34 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Mar 2017 12:34:11 +0000 (12:34 +0000)
src/libserver/symbols_cache.c

index 42232b9ec71c1718d0ff44a68dff4a0f79e2df04..5b532b97994a440f654d2b5dd88102540dd365ac 100644 (file)
@@ -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)) {