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?
<!-- Kamailio Pull Request Template -->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [X] PR should be backported to stable branches
- [X] Tested changes locally
- [X] Related to issue #3037
#### Description
I can not remember the last time I wrote any C which was likely a class assignment last century. Anyways I came across this issue and it seemed in reach to get the ball rolling. I know this PR needs more work but my goal is to share my progress to help move this feature forward.
Based on https://github.com/svaarala/duktape/tree/master/extras/module-node
added:
- duk_module_node.h
- duk_module_node.c
updated:
- app_jsdt_api.h
- app_jsdt_api.c
Included the extra header and initialize the bindings after 'load JS context' was created.
added `cb_resolve_module` to resolve the full file system path for requested_id and parent_id
added `cb_load_module` function which uses `jsdt_load_file` to load resolved file
With absolute and relative modules working I met my current requirements to allow breaking routing into multiple smaller files.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3038
-- Commit Summary --
* app_jsdt: add duk_module_node for JS module resolution
-- File Changes --
M src/modules/app_jsdt/app_jsdt_api.c (65)
M src/modules/app_jsdt/app_jsdt_api.h (3)
A src/modules/app_jsdt/duk_module_node.c (333)
A src/modules/app_jsdt/duk_module_node.h (17)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3038.patchhttps://github.com/kamailio/kamailio/pull/3038.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3038
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3038(a)github.com>