fix: better start/stop

This commit is contained in:
erhant 2026-06-23 16:46:56 +03:00
parent c67fd88978
commit 21ff5e6656
2 changed files with 15 additions and 11 deletions

20
flake.lock generated
View File

@ -21,11 +21,11 @@
"logos-module-builder": "logos-module-builder_4"
},
"locked": {
"lastModified": 1782215779,
"narHash": "sha256-x9L1jcK6XfVl40tsqpfrdERLmuGaEDBsFYzNIDdiZPM=",
"lastModified": 1782222303,
"narHash": "sha256-T//08rBmSvOOhvZZ5if8Gnaq1okEuSGt2ASym1eDyPY=",
"ref": "erhant/migr-to-logos-module-builder-update-LEZ",
"rev": "b5a283124a909854eba695ed213356269b45b414",
"revCount": 45,
"rev": "06396d7aeccdd7c3e7310c5acf4e687c12109052",
"revCount": 47,
"type": "git",
"url": "https://github.com/logos-blockchain/lez-indexer-module"
},
@ -2013,16 +2013,16 @@
"rust-rapidsnark": "rust-rapidsnark"
},
"locked": {
"lastModified": 1782215206,
"narHash": "sha256-BKwz2qgH2Mu1fSCooc203iYOcxBREcjLnFDF07Ro/H0=",
"ref": "erhant/fix-indexer-ffi",
"rev": "84c84d885af1f6ccf3ae76a99d93183dbdc3a925",
"revCount": 2778,
"lastModified": 1782219627,
"narHash": "sha256-mF9P5483XSGudP69VWlCeRTYFocklDwHGvPNujnDxTM=",
"ref": "main",
"rev": "a9df90c5b655446708395c99f627834eb822c48d",
"revCount": 2790,
"type": "git",
"url": "https://github.com/logos-blockchain/logos-execution-zone"
},
"original": {
"ref": "erhant/fix-indexer-ffi",
"ref": "main",
"type": "git",
"url": "https://github.com/logos-blockchain/logos-execution-zone"
}

View File

@ -35,7 +35,7 @@ constexpr quint64 kGapRebuildThreshold = 8;
const char* const kDefaultConfig = R"JSON({
"consensus_info_polling_interval": "1s",
"bedrock_config": {
"addr": "http://localhost:8080",
"addr": "http://localhost:18080",
"backoff": {
"start_delay": "100ms",
"max_retries": 5
@ -588,6 +588,10 @@ QString LezExplorerUiBackend::readConfigFile() const
bool LezExplorerUiBackend::startIndexerFromFile()
{
// start_indexer is idempotent and won't restart a running indexer, so stop
// any current one first — this is what lets a re-saved config (e.g. a new
// bedrock addr) actually take effect. No-op on the first start.
modules().lez_indexer_module.stop_indexer();
const qlonglong code = modules().lez_indexer_module.start_indexer(configFilePath());
if (code != 0) {
emit error(QStringLiteral("start_indexer failed (code %1)").arg(code));