diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-10 23:39:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-10 23:39:46 +0000 |
commit | dd1af5b84e7bb401dbe9af004da9f4b49ed97b23 (patch) | |
tree | 289ec424f7e0add040971ccee52611bf1fb65697 /src/libstat/stat_config.c | |
parent | 8bcc03ac88d6f99058bd1a6660f30cb535cf1515 (diff) | |
download | rspamd-dd1af5b84e7bb401dbe9af004da9f4b49ed97b23.tar.gz rspamd-dd1af5b84e7bb401dbe9af004da9f4b49ed97b23.zip |
Fix processing of caches
Diffstat (limited to 'src/libstat/stat_config.c')
-rw-r--r-- | src/libstat/stat_config.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libstat/stat_config.c b/src/libstat/stat_config.c index 0ae36af1b..50897b082 100644 --- a/src/libstat/stat_config.c +++ b/src/libstat/stat_config.c @@ -182,11 +182,14 @@ rspamd_stat_init (struct rspamd_config *cfg, struct event_base *ev_base) msg_debug_config ("added backend %s for symbol %s", bk->name, stf->symbol); - st->cache = rspamd_stat_get_cache (cache_name); - g_assert (st->cache != NULL); - st->cachecf = st->cache->init (stat_ctx, cfg, st, cache_obj); - msg_debug_config ("added cache %s for symbol %s", - st->cache->name, stf->symbol); + /* XXX: bad hack to pass statfiles configuration to cache */ + if (cl->cache == NULL) { + cl->cache = rspamd_stat_get_cache (cache_name); + g_assert (cl->cache != NULL); + cl->cachecf = cl->cache->init (stat_ctx, cfg, st, cache_obj); + msg_debug_config ("added cache %s for symbol %s", + cl->cache->name, stf->symbol); + } if (st->bkcf == NULL) { msg_err_config ("cannot init backend %s for statfile %s", |