FS-3127 --resolve please reopen if not fixed
This commit is contained in:
parent
4c6886d7e2
commit
84de992b8b
|
@ -562,27 +562,28 @@ char *cc_execute_sql2str(cc_queue_t *queue, switch_mutex_t *mutex, char *sql, ch
|
|||
|
||||
switch_cache_db_handle_t *dbh = NULL;
|
||||
|
||||
if (!(dbh = cc_get_db_handle())) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (mutex) {
|
||||
switch_mutex_lock(mutex);
|
||||
} else {
|
||||
switch_mutex_lock(globals.mutex);
|
||||
}
|
||||
|
||||
if (!(dbh = cc_get_db_handle())) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = switch_cache_db_execute_sql2str(dbh, sql, resbuf, len, NULL);
|
||||
|
||||
end:
|
||||
switch_cache_db_release_db_handle(&dbh);
|
||||
|
||||
if (mutex) {
|
||||
switch_mutex_unlock(mutex);
|
||||
} else {
|
||||
switch_mutex_unlock(globals.mutex);
|
||||
}
|
||||
|
||||
switch_cache_db_release_db_handle(&dbh);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue