[Core] Fix wrong sqldb initialization order causing crash on load.
This commit is contained in:
parent
1435577eaf
commit
a124937f0c
|
@ -3822,6 +3822,14 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
|
||||||
skip:
|
skip:
|
||||||
|
|
||||||
if (sql_manager.manage) {
|
if (sql_manager.manage) {
|
||||||
|
/* Initiate switch_sql_queue_manager */
|
||||||
|
switch_threadattr_create(&thd_attr, sql_manager.memory_pool);
|
||||||
|
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
||||||
|
switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME);
|
||||||
|
switch_core_sqldb_start_thread();
|
||||||
|
switch_thread_create(&sql_manager.db_thread, thd_attr, switch_core_sql_db_thread, NULL, sql_manager.memory_pool);
|
||||||
|
|
||||||
|
/* switch_sql_queue_manager initiated, now we can bind to core_event_handler */
|
||||||
#ifdef SWITCH_SQL_BIND_EVERY_EVENT
|
#ifdef SWITCH_SQL_BIND_EVERY_EVENT
|
||||||
switch_event_bind("core_db", SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
|
switch_event_bind("core_db", SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
|
||||||
#else
|
#else
|
||||||
|
@ -3851,13 +3859,6 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
|
||||||
switch_event_bind("core_db", SWITCH_EVENT_NAT, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
|
switch_event_bind("core_db", SWITCH_EVENT_NAT, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
|
||||||
switch_event_bind("core_db", SWITCH_EVENT_CODEC, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
|
switch_event_bind("core_db", SWITCH_EVENT_CODEC, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch_threadattr_create(&thd_attr, sql_manager.memory_pool);
|
|
||||||
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
|
||||||
switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME);
|
|
||||||
switch_core_sqldb_start_thread();
|
|
||||||
switch_thread_create(&sql_manager.db_thread, thd_attr, switch_core_sql_db_thread, NULL, sql_manager.memory_pool);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_cache_db_release_db_handle(&sql_manager.dbh);
|
switch_cache_db_release_db_handle(&sql_manager.dbh);
|
||||||
|
|
Loading…
Reference in New Issue