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)
(cherry picked from commit 0684e98)
  • Loading branch information
liviuchircu committed Nov 5, 2020
1 parent 7c251f5 commit f721cc0
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 @@ -203,9 +203,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 @@ -248,9 +248,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 f721cc0

Please sign in to comment.