mirror of https://github.com/sipwise/kamailio.git
Change-Id: Ifb286dcc5e0f7cf78b1d64e212339ffcb2acde23mr10.4
parent
8ce53be4f2
commit
6e53e67549
@ -0,0 +1,24 @@
|
|||||||
|
From: Victor Seva <vseva@sipwise.com>
|
||||||
|
Date: Mon, 28 Feb 2022 15:24:21 +0100
|
||||||
|
Subject: db_redis: clean previous connection before trying to reconnect
|
||||||
|
|
||||||
|
---
|
||||||
|
src/modules/db_redis/redis_connection.c | 5 +++++
|
||||||
|
1 file changed, 5 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/modules/db_redis/redis_connection.c b/src/modules/db_redis/redis_connection.c
|
||||||
|
index dd421a7..d6c2416 100644
|
||||||
|
--- a/src/modules/db_redis/redis_connection.c
|
||||||
|
+++ b/src/modules/db_redis/redis_connection.c
|
||||||
|
@@ -112,6 +112,11 @@ int db_redis_connect(km_redis_con_t *con) {
|
||||||
|
db = atoi(con->id->database);
|
||||||
|
reply = NULL;
|
||||||
|
|
||||||
|
+ if(con->con) {
|
||||||
|
+ LM_DBG("free old connection first\n");
|
||||||
|
+ redisFree(con->con);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
// TODO: introduce require_master mod-param and check if we're indeed master
|
||||||
|
// TODO: on carrier, if we have db fail-over, the currently connected
|
||||||
|
// redis server will become slave without dropping connections?
|
Loading…
Reference in new issue