mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: remove singleton db (#4208)
* refactor: remove singleton db * chore: fix warning * chore: fix warning * chore: update test * chore: only resotre or backup when init call * test: fix * test: fix * test: fix * fix: timeout notification * chore: rename * chore: rename * chore: disable test * chore: remove log * chore: remove log * chore: add log * chore: rename test functions * chore: add test asset * chore: bump client api * chore: disable some tests
This commit is contained in:
@ -70,6 +70,13 @@ pub extern "C" fn init_sdk(data: *mut c_char) -> i64 {
|
||||
DEFAULT_NAME.to_string(),
|
||||
)
|
||||
.log_filter("info", log_crates);
|
||||
|
||||
// Ensure that the database is closed before initialization. Also, verify that the init_sdk function can be called
|
||||
// multiple times (is reentrant). Currently, only the database resource is exclusive.
|
||||
if let Some(core) = &*APPFLOWY_CORE.0.lock() {
|
||||
core.close_db();
|
||||
}
|
||||
|
||||
*APPFLOWY_CORE.0.lock() = Some(AppFlowyCore::new(config));
|
||||
0
|
||||
}
|
||||
|
Reference in New Issue
Block a user