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)

(cherry picked from commit ff7b584)
(cherry picked from commit a54424b)
  • Loading branch information
liviuchircu committed Nov 4, 2020
1 parent 914d38a commit 0684e98
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 @@ -206,9 +206,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 @@ -274,9 +274,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 0684e98

Please sign in to comment.