gboolean
rspamd_symbols_cache_process_symbols (struct rspamd_task * task,
- struct symbols_cache *cache)
+ struct symbols_cache *cache, gint stage)
{
struct cache_item *item = NULL;
struct cache_savepoint *checkpoint;
}
}
- if (all_done) {
+ if (all_done || stage == RSPAMD_TASK_STAGE_FILTERS) {
checkpoint->pass = RSPAMD_CACHE_PASS_FILTERS;
- return rspamd_symbols_cache_process_symbols (task, cache);
+ return rspamd_symbols_cache_process_symbols (task, cache, stage);
}
break;
case RSPAMD_CACHE_PASS_FILTERS:
}
}
- if (checkpoint->waitq->len == 0) {
+ if (checkpoint->waitq->len == 0 ||
+ stage == RSPAMD_TASK_STAGE_POST_FILTERS) {
checkpoint->pass = RSPAMD_CACHE_PASS_POSTFILTERS;
- return rspamd_symbols_cache_process_symbols (task, cache);
+ return rspamd_symbols_cache_process_symbols (task, cache, stage);
}
break;
* @param saved_item pointer to currently saved item
*/
gboolean rspamd_symbols_cache_process_symbols (struct rspamd_task *task,
- struct symbols_cache *cache);
+ struct symbols_cache *cache, gint stage);
/**
* Validate cache items agains theirs weights defined in metrics
break;
case RSPAMD_TASK_STAGE_PRE_FILTERS:
- rspamd_symbols_cache_process_symbols (task, task->cfg->cache);
+ rspamd_symbols_cache_process_symbols (task, task->cfg->cache,
+ RSPAMD_TASK_STAGE_PRE_FILTERS);
break;
case RSPAMD_TASK_STAGE_FILTERS:
- rspamd_symbols_cache_process_symbols (task, task->cfg->cache);
+ rspamd_symbols_cache_process_symbols (task, task->cfg->cache,
+ RSPAMD_TASK_STAGE_FILTERS);
break;
case RSPAMD_TASK_STAGE_CLASSIFIERS:
break;
case RSPAMD_TASK_STAGE_POST_FILTERS:
- rspamd_symbols_cache_process_symbols (task, task->cfg->cache);
+ rspamd_symbols_cache_process_symbols (task, task->cfg->cache,
+ RSPAMD_TASK_STAGE_POST_FILTERS);
if ((task->flags & RSPAMD_TASK_FLAG_LEARN_AUTO) &&
!RSPAMD_TASK_IS_EMPTY (task) &&