|
@@ -339,7 +339,8 @@ static int child_init(int _rank)
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- ul_dbh = ul_dbf.init(&db_url); /* Get a new database connection */
|
|
|
|
|
|
+ if (!ul_dbh)
|
|
|
|
+ ul_dbh = ul_dbf.init(&db_url); /* Get a new database connection */
|
|
if (!ul_dbh) {
|
|
if (!ul_dbh) {
|
|
LM_ERR("child(%d): failed to connect to database\n", _rank);
|
|
LM_ERR("child(%d): failed to connect to database\n", _rank);
|
|
return -1;
|
|
return -1;
|
|
@@ -369,6 +370,10 @@ static int mi_child_init(void)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
if (db_mode != NO_DB) {
|
|
if (db_mode != NO_DB) {
|
|
|
|
+ if (ul_dbh) {
|
|
|
|
+ done = 1;
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
ul_dbh = ul_dbf.init(&db_url);
|
|
ul_dbh = ul_dbf.init(&db_url);
|
|
if (!ul_dbh) {
|
|
if (!ul_dbh) {
|
|
LM_ERR("failed to connect to database\n");
|
|
LM_ERR("failed to connect to database\n");
|