[Fix] Stability
This commit is contained in:
parent
e1dd86ec02
commit
8160f8d0cb
44 changed files with 796 additions and 1296 deletions
|
|
@ -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"] }
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue