Skip to content

Commit

Permalink
rofl-appd: Fix API server startup
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Jan 22, 2025
1 parent 13c66b6 commit 30a5687
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion rofl-appd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ where
let env: Arc<dyn state::Env> = Arc::new(state::EnvImpl::new(env));

// Server configuration.
let rocket_cfg = Figment::new().join(("address", cfg.address));
let rocket_cfg = Figment::from(rocket::config::Config::default())
.select("default")
.merge(("address", cfg.address))
.merge(("reuse", true));

rocket::custom(rocket_cfg)
.manage(env)
Expand Down
2 changes: 1 addition & 1 deletion rofl-containers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rofl-containers"
version = "0.3.2"
version = "0.3.3"
edition = "2021"

[dependencies]
Expand Down
9 changes: 8 additions & 1 deletion rofl-containers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ impl App for ContainersApp {
address: ROFL_APPD_ADDRESS,
kms: kms.clone(),
};
let _ = rofl_appd::start(cfg, env.clone()).await;
let appd_logger = logger.clone();
let appd_env = env.clone();
tokio::spawn(async move {
if let Err(err) = rofl_appd::start(cfg, appd_env).await {
slog::error!(appd_logger, "failed to start API server"; "err" => ?err);
process::abort();
}
});

// Initialize containers.
slog::info!(logger, "initializing container environment");
Expand Down

0 comments on commit 30a5687

Please sign in to comment.