diff options
Diffstat (limited to 'src/lua/lua_redis.c')
-rw-r--r-- | src/lua/lua_redis.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c index cf416a12a..82ef0c53b 100644 --- a/src/lua/lua_redis.c +++ b/src/lua/lua_redis.c @@ -675,6 +675,10 @@ rspamd_lua_redis_prepare_connection (lua_State *L, gint *pcbref) lua_pop (L, 1); /* table */ + if (session && rspamd_session_is_destroying (session)) { + ret = FALSE; + } + if (ret && addr != NULL) { ctx = g_malloc0 (sizeof (struct lua_redis_ctx)); @@ -1200,6 +1204,13 @@ lua_redis_add_cmd (lua_State *L) LL_PREPEND (sp_ud->c->specific, sp_ud); + if (ud->s && rspamd_session_is_destroying (ud->s)) { + lua_pushboolean (L, 0); + lua_pushstring (L, "session is terminating"); + + return 2; + } + ret = redisAsyncCommandArgv (sp_ud->c->ctx, lua_redis_callback, sp_ud, |