aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-17 09:35:04 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-17 09:35:04 +0100
commitccee4b3beef5b6cf5d09e9ef8f4e2c5744f115de (patch)
treec0c362823360aa8828dfac00f81afc5b1e83d482 /src
parent2ca2d1a294724d8447ccb95e8f687a41cd809752 (diff)
downloadrspamd-ccee4b3beef5b6cf5d09e9ef8f4e2c5744f115de.tar.gz
rspamd-ccee4b3beef5b6cf5d09e9ef8f4e2c5744f115de.zip
[Fix] Restore redis runtime state
Diffstat (limited to 'src')
-rw-r--r--src/libstat/backends/redis_backend.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index 8aed06994..823a5f71b 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -767,14 +767,13 @@ rspamd_redis_connected (redisAsyncContext *c, gpointer r, gpointer priv)
}
rt->learned = val;
-
- rt->conn_state = RSPAMD_REDIS_CONNECTED;
REF_RETAIN (rt);
-
msg_debug_task ("connected to redis server, tokens learned for %s: %uL",
rt->redis_object_expanded, rt->learned);
rspamd_upstream_ok (rt->selected);
+ /* This also set state to terminated state */
rspamd_session_remove_event (task->s, rspamd_redis_fin, rt);
+ rt->conn_state = RSPAMD_REDIS_CONNECTED;
}
else {
/* This could be caused by removing redis context forcefully */