[Fix] Stability

This commit is contained in:
Alex Emmet 2026-08-28 13:22:59 +02:00
commit 8160f8d0cb
No known key found for this signature in database
44 changed files with 796 additions and 1296 deletions

View file

@ -7,7 +7,6 @@ edition = "2024"
iota-daemon-lib = { path = "../iota-daemon-lib" }
iota-ipc = { path = "../iota-ipc" }
iota-logger = { path = "../iota-logger" }
iota-state = { path = "../iota-state" }
iota-paths = { path = "../iota-paths" }
iota-storage = { path = "../iota-storage" }
iota-util = { path = "../iota-util" }
@ -15,4 +14,3 @@ iota-terms = { path = "../iota-terms" }
omikron-connector = { path = "../omikron-connector" }
web-server = { path = "../web-server" }
tokio = { version = "1.50.0", features = ["full"] }
tokio-util = { version = "0.7", features = ["rt"] }

View file

@ -102,15 +102,18 @@ async fn main() -> ExitCode {
let (state_tx, state_rx) = watch::channel(runtime.snapshot());
runtime.set_startup_phase(StartupPhase::LoadingUsers);
if tokio::task::spawn_blocking(user_manager::load_users_sync)
.await
.ok()
.and_then(Result::ok)
.is_none()
{
let storage_error = match iota_storage::util::db::verify_and_backup_database() {
Ok(()) => tokio::task::spawn_blocking(user_manager::load_users_sync)
.await
.map_err(|error| format!("user storage task failed: {error}"))
.and_then(|result| result.map_err(|error| error.to_string()))
.err(),
Err(error) => Some(error.to_string()),
};
if let Some(error) = storage_error {
runtime.set_component_failed(
iota_ipc::ComponentId::Storage,
"user storage failed to load".into(),
format!("user storage failed to load: {error}"),
);
} else {
runtime.set_component_healthy(iota_ipc::ComponentId::Storage, None);