Skip to content

Commit

Permalink
sql_cacher: abort startup if DB connections/queries tests fail
Browse files Browse the repository at this point in the history
(cherry picked from commit 2ad1e15)
  • Loading branch information
rvlad-patrascu committed Nov 27, 2020
1 parent 73fab41 commit 7873553
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions modules/sql_cacher/sql_cacher.c
Expand Up @@ -1152,7 +1152,7 @@ static void cache_init_load(int sender, void *param)

static int mod_init(void)
{
cache_entry_t *c_entry, *c_prev = NULL, *c_tmp;
cache_entry_t *c_entry, *c_prev = NULL;
db_handlers_t *db_hdls;
char use_timer = 0;

Expand Down Expand Up @@ -1195,14 +1195,7 @@ static int mod_init(void)
while (c_entry) {
if ((db_hdls = db_init_test_conn(c_entry)) == NULL) {
LM_ERR("Failed to validate db conns for cache entry\n");
if (c_prev)
c_prev->next = c_entry->next;
else
*entry_list = c_entry->next;
c_tmp = c_entry;
c_entry = c_entry->next;
free_c_entry(c_tmp);
continue;
return -1;
}

if (!c_entry->on_demand) {
Expand Down

0 comments on commit 7873553

Please sign in to comment.