Module: kamailio
Branch: master
Commit: 2b475553ef77f63cb444c34ad6c2df0ea237c88b
URL:
https://github.com/kamailio/kamailio/commit/2b475553ef77f63cb444c34ad6c2df0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-03-12T15:30:49+01:00
presence: do not init db in dmq worker for in-memory only mode
- GH #2642
---
Modified: src/modules/presence/presence_dmq.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2b475553ef77f63cb444c34ad6c2df0…
Patch:
https://github.com/kamailio/kamailio/commit/2b475553ef77f63cb444c34ad6c2df0…
---
diff --git a/src/modules/presence/presence_dmq.c b/src/modules/presence/presence_dmq.c
index 287f2fd67d..8dd7c99fe8 100644
--- a/src/modules/presence/presence_dmq.c
+++ b/src/modules/presence/presence_dmq.c
@@ -102,11 +102,15 @@ static int pres_dmq_init_proc()
}
}
+ if(publ_cache_mode==PS_PCACHE_RECORD && pres_subs_dbmode==NO_DB) {
+ goto finish;
+ }
+
if(!pa_db) {
LM_DBG("Initializing presence DB connection for pid (%d)\n", my_pid());
if(pa_dbf.init == 0) {
- LM_ERR("dmq_worker_init: database not bound\n");
+ LM_ERR("database not bound\n");
return -1;
}
@@ -123,6 +127,7 @@ static int pres_dmq_init_proc()
}
}
+finish:
*pres_dmq_proc_init = 1;
LM_DBG("process initialization complete\n");