Module: kamailio
Branch: master
Commit: 78c8d084e30373aacc456fd41062b68e6e82ea6f
URL:
https://github.com/kamailio/kamailio/commit/78c8d084e30373aacc456fd41062b68…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-03-01T10:35:23+01:00
db_redis: clean previous connection before trying to reconnect
---
Modified: src/modules/db_redis/redis_connection.c
---
Diff:
https://github.com/kamailio/kamailio/commit/78c8d084e30373aacc456fd41062b68…
Patch:
https://github.com/kamailio/kamailio/commit/78c8d084e30373aacc456fd41062b68…
---
diff --git a/src/modules/db_redis/redis_connection.c
b/src/modules/db_redis/redis_connection.c
index 1166117961..5cf36ffb36 100644
--- a/src/modules/db_redis/redis_connection.c
+++ b/src/modules/db_redis/redis_connection.c
@@ -124,6 +124,11 @@ int db_redis_connect(km_redis_con_t *con) {
#endif
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?