Skip to content

Commit

Permalink
dialplan: create DB connection from all workers
Browse files Browse the repository at this point in the history
This allows modules, such as mi_script, to run reload commands inline,
and not through a dedicated MI process.
  • Loading branch information
razvancrainea committed Sep 13, 2024
1 parent a47c16f commit 9a3caec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/dialplan/dialplan.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,6 @@ static int child_init(int rank)
{
dp_connection_list_p el;

/* only process with rank 1 loads data */
if (rank != 1)
return 0;

/* Connect to DBs.... */
for(el = dp_conns; el; el = el->next){
if (dp_connect_db(el) != 0) {
Expand All @@ -433,6 +429,10 @@ static int child_init(int rank)
}
}

/* only process with rank 1 loads data */
if (rank != 1)
return 0;

/* ...and fire the RPC to perform the data load in the
* same process, but after child_init is done */
if (ipc_send_rpc( process_no, dp_rpc_data_load, NULL)<0) {
Expand Down

0 comments on commit 9a3caec

Please sign in to comment.