From b2fde3c000d00c04da374b2c31719e29a237b2a4 Mon Sep 17 00:00:00 2001 From: erhant Date: Thu, 2 Jul 2026 14:29:16 +0300 Subject: [PATCH] fix: fallback to CWD --- src/lez_indexer_module_impl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lez_indexer_module_impl.cpp b/src/lez_indexer_module_impl.cpp index 67539c5..ffb1804 100644 --- a/src/lez_indexer_module_impl.cpp +++ b/src/lez_indexer_module_impl.cpp @@ -92,10 +92,12 @@ int64_t LezIndexerModuleImpl::reset_storage(const std::string& config_path) { return stop_code; } - const std::string& storage = instancePersistencePath(); + // if running from Basecamp, the instance persistence path is stable and owned by the host; + // otherwise it falls back to the process CWD (the same path start_indexer uses). + std::filesystem::path storage = instancePersistencePath(); if (storage.empty()) { - error("reset_storage", "no instance persistence path; refusing to wipe (nothing to target)"); - return -1; + warn("reset_storage", "no instance persistence path; using the working directory (matches start_indexer)"); + storage = "."; } // FFI stores RocksDB at /rocksdb-{channel_id} @@ -116,7 +118,7 @@ int64_t LezIndexerModuleImpl::reset_storage(const std::string& config_path) { return -1; } - const std::filesystem::path store = std::filesystem::path(storage) / ("rocksdb-" + channel_id); + const std::filesystem::path store = storage / ("rocksdb-" + channel_id); std::error_code ec; if (!std::filesystem::exists(store, ec)) { info("reset_storage", "no store at " + store.string() + "; nothing to wipe");