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:
Nathan.fooo
2023-12-27 11:42:39 +08:00
committed by GitHub
parent 121ed5a06e
commit df8409178b
110 changed files with 947 additions and 829 deletions

View File

@ -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
}