Skip to content

Commit

Permalink
b2b entities/logic: Inherit db_default_url if possible
Browse files Browse the repository at this point in the history
If there is still no DB URL, simply start without DB support (just as
before)
  • Loading branch information
liviuchircu committed Jul 8, 2020
1 parent 990d18f commit ff7b584
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/b2b_entities/b2b_entities.c
Expand Up @@ -222,9 +222,12 @@ static int mod_init(void)
return -1;
}
memset(&b2be_dbf, 0, sizeof(db_func_t));

if(b2be_db_mode)
init_db_url(db_url, 1);

if(b2be_db_mode && db_url.s)
{
db_url.len = strlen(db_url.s);
b2be_dbtable.len = strlen(b2be_dbtable.s);

/* binding to database module */
Expand Down
4 changes: 3 additions & 1 deletion modules/b2b_logic/b2b_logic.c
Expand Up @@ -305,9 +305,11 @@ static int mod_init(void)
return -1;
}

if(b2bl_db_mode)
init_db_url(db_url, 1);

if(b2bl_db_mode && db_url.s)
{
db_url.len = strlen(db_url.s);
b2bl_dbtable.len = strlen(b2bl_dbtable.s);
/* binding to database module */
if (db_bind_mod(&db_url, &b2bl_dbf))
Expand Down

0 comments on commit ff7b584

Please sign in to comment.