Separate core, UTUN and chat lifecycles with owned asynchronous work
This commit is contained in:
1 parent
5838e63cde
commit
72fee9e245
47 files changed
+708
-337
No files matched your search
@@ -213,7 +213,7 @@ void UtunNode::runLoop() {
|
||||
gui_bridge_set_uasync(ua);
|
||||
gui_bridge_set_inst(m_instance);
|
||||
|
||||
if (utun_instance_init(m_instance) != 0) {
|
||||
if (utun_core_start(m_instance) != 0) {
|
||||
QMetaObject::invokeMethod(this, [this] { emit error("utun_instance_init failed"); });
|
||||
utun_instance_destroy(m_instance);
|
||||
m_instance = nullptr;
|
||||
@@ -234,14 +234,11 @@ void UtunNode::runLoop() {
|
||||
gui_bridge_post(type, data, len);
|
||||
});
|
||||
|
||||
/* Initialize chat_core (DB) and chat_sync (channel/message P2P sync) */
|
||||
chat_core_init(m_instance, QString(m_dbPath + "/chats.db").toUtf8().constData());
|
||||
chat_sync_init(m_instance);
|
||||
chat_media_backfill(m_instance);
|
||||
chat_media_startup_backfill_init(m_instance);
|
||||
dm_mailbox_init(m_instance);
|
||||
dm_core_init(m_instance);
|
||||
call_init(m_instance);
|
||||
if (chat_service_start(m_instance) != 0) {
|
||||
QMetaObject::invokeMethod(this, [this] { emit error("chat_service_start failed"); });
|
||||
utun_instance_destroy(m_instance); m_instance = nullptr;
|
||||
uasync_destroy(ua, 0); m_ua = nullptr; return;
|
||||
}
|
||||
chat_core_sync_my_addresses(m_instance);
|
||||
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_GENERAL, "chat_core + chat_sync initialized");
|
||||
|
||||
Reference in new issue
Block a user