return TRUE;
}
-
void
-rspamd_symbols_cache_destroy (struct symbols_cache *cache)
+rspamd_symbols_cache_save (struct symbols_cache *cache)
{
- GList *cur;
- struct delayed_cache_dependency *ddep;
- struct delayed_cache_condition *dcond;
-
if (cache != NULL) {
if (cache->cfg->cache_filename) {
cache->cfg->cache_filename);
}
}
+ }
+}
+
+void
+rspamd_symbols_cache_destroy (struct symbols_cache *cache)
+{
+ GList *cur;
+ struct delayed_cache_dependency *ddep;
+ struct delayed_cache_condition *dcond;
+
+ if (cache != NULL) {
+ rspamd_symbols_cache_save (cache);
if (cache->delayed_deps) {
cur = cache->delayed_deps;
*/
void rspamd_symbols_cache_destroy (struct symbols_cache *cache);
+/**
+ * Saves symbols cache to disk if possible
+ * @param cache
+ */
+void rspamd_symbols_cache_save (struct symbols_cache *cache);
+
/**
* Load symbols cache from file, must be called _after_ init_symbols_cache
*/
struct rspamd_config *tmp_cfg, *old_cfg;
gchar *cfg_file;
+ rspamd_symbols_cache_save (rspamd_main->cfg->cache);
tmp_cfg = rspamd_config_new ();
g_hash_table_unref (tmp_cfg->c_modules);
tmp_cfg->c_modules = g_hash_table_ref (rspamd_main->cfg->c_modules);