[fdb_kvdb] fix lock issue to fix block on first run (#295)

This commit is contained in:
Mr. Chip 2024-05-10 15:27:33 +08:00 committed by GitHub
parent 86d00aa5fd
commit 60675db070
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -1798,9 +1798,11 @@ fdb_err_t fdb_kvdb_init(fdb_kvdb_t db, const char *name, const char *path, struc
#endif /* FDB_KV_USING_CACHE */
FDB_DEBUG("KVDB size is %" PRIu32 " bytes.\n", db_max_size(db));
db_unlock(db);
result = _fdb_kv_load(db);
db_lock(db);
#ifdef FDB_KV_AUTO_UPDATE
if (result == FDB_NO_ERR) {
kv_auto_update(db);