Skip to content

Commit

Permalink
fix: Move ResetAllDB implementation inside OPENMIND_STORAGE_LEVELDB g…
Browse files Browse the repository at this point in the history
…uard
  • Loading branch information
devin-ai-integration[bot] authored and ohhmm committed Feb 14, 2025
1 parent ab6287b commit 936162b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion omnn/storage/LevelDbCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string>


using namespace omnn::rt::storage;
using namespace omnn::rt::storage;


LevelDbCache::LevelDbCache(const std::string_view& path)
Expand Down Expand Up @@ -40,6 +40,20 @@ LevelDbCache::~LevelDbCache() {
delete _db;
}

bool LevelDbCache::ResetAllDB(const path_str_t& path) {

Check failure on line 43 in omnn/storage/LevelDbCache.cpp

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

no declaration matches ‘bool omnn::rt::storage::LevelDbCache::ResetAllDB(const omnn::rt::storage::CacheBase::path_str_t&)’

Check failure on line 43 in omnn/storage/LevelDbCache.cpp

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

‘using omnn::rt::storage::CacheBase::path_str_t = class boost::filesystem::path’ is private within this context

Check failure on line 43 in omnn/storage/LevelDbCache.cpp

View workflow job for this annotation

GitHub Actions / build (macos-latest)

out-of-line definition of 'ResetAllDB' does not match any declaration in 'omnn::rt::storage::LevelDbCache'

Check failure on line 43 in omnn/storage/LevelDbCache.cpp

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'path_str_t' is a private member of 'omnn::rt::storage::CacheBase'

Check failure on line 43 in omnn/storage/LevelDbCache.cpp

View workflow job for this annotation

GitHub Actions / build (windows-latest)

'ResetAllDB': member function not declared in 'omnn::rt::storage::LevelDbCache'
// Delete all keys in the database
auto it = _db->NewIterator(leveldb::ReadOptions());
for (it->SeekToFirst(); it->Valid(); it->Next()) {
auto status = _db->Delete(leveldb::WriteOptions(), it->key());
if (!status.ok()) {
delete it;
return false;
}
}
delete it;
return true;
}

namespace{
std::once_flag dbConnectionOptionsInitializedFlag;
}
Expand Down

0 comments on commit 936162b

Please sign in to comment.