1
0
mirror of https://github.com/armink/FlashDB.git synced 2025-01-16 20:12:52 +08:00

adding ifdef guards to update method. should only be called if cache is used.

This commit is contained in:
Tobias Wiens 2022-04-24 23:18:12 +02:00
parent 7062902a3e
commit 0b5ac0039b

View File

@ -1482,8 +1482,10 @@ static bool check_and_recovery_kv_cb(fdb_kv_t kv, void *arg1, void *arg2)
_fdb_write_status((fdb_db_t)db, kv->addr.start, status_table, FDB_KV_STATUS_NUM, FDB_KV_ERR_HDR, true);
return true;
} else if (kv->crc_is_ok && kv->status == FDB_KV_WRITE) {
/* update the cache when first load */
#ifdef FDB_KV_USING_CACHE
/* update the cache when first load. If caching is disabled, this step is not performed */
update_kv_cache(db, kv->name, kv->name_len, kv->addr.start);
#endif
}
return false;