Skip to content

Commit

Permalink
[Minor] Release redis pool after Lua state has been destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Oct 20, 2021
1 parent 47e1e81 commit 9d0e80d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/libserver/cfg_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,6 @@ rspamd_config_free (struct rspamd_config *cfg)
rspamd_re_cache_unref (cfg->re_cache);
g_ptr_array_free (cfg->c_modules, TRUE);

#ifdef WITH_HIREDIS
if (cfg->redis_pool) {
rspamd_redis_pool_destroy (cfg->redis_pool);
}
#endif

if (cfg->monitored_ctx) {
rspamd_monitored_ctx_destroy (cfg->monitored_ctx);
}
Expand All @@ -351,6 +345,12 @@ rspamd_config_free (struct rspamd_config *cfg)
lua_close (cfg->lua_state);
}

#ifdef WITH_HIREDIS
if (cfg->redis_pool) {
rspamd_redis_pool_destroy (cfg->redis_pool);
}
#endif

rspamd_upstreams_library_unref (cfg->ups_ctx);
HASH_CLEAR (hh, cfg->actions);

Expand Down

0 comments on commit 9d0e80d

Please sign in to comment.