Browse code

presence: do not init db in dmq worker for in-memory only mode

- GH #2642

(cherry picked from commit 2b475553ef77f63cb444c34ad6c2df0ea237c88b)
(cherry picked from commit 293e161fb8828310954ea37f522c2e0b526ac827)

Daniel-Constantin Mierla authored on 12/03/2021 14:30:49 • Henning Westerholt committed on 22/10/2021 11:29:08
Showing 1 changed files
... ...
@@ -102,11 +102,15 @@ static int pres_dmq_init_proc()
102 102
 		}
103 103
 	}
104 104
 
105
+	if(publ_cache_mode==PS_PCACHE_RECORD && pres_subs_dbmode==NO_DB) {
106
+		goto finish;
107
+	}
108
+
105 109
 	if(!pa_db) {
106 110
 		LM_DBG("Initializing presence DB connection for pid (%d)\n", my_pid());
107 111
 
108 112
 		if(pa_dbf.init == 0) {
109
-			LM_ERR("dmq_worker_init: database not bound\n");
113
+			LM_ERR("database not bound\n");
110 114
 			return -1;
111 115
 		}
112 116
 
... ...
@@ -123,6 +127,7 @@ static int pres_dmq_init_proc()
123 127
 		}
124 128
 	}
125 129
 
130
+finish:
126 131
 	*pres_dmq_proc_init = 1;
127 132
 
128 133
 	LM_DBG("process initialization complete\n");