Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
davepacheco committed Nov 13, 2024
1 parent 39b94d4 commit 364413d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/mock-server/src/lib/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use dropshot::{
TypedBody, WebsocketConnection,
};
use futures::SinkExt;
use slog::{error, info, Logger};
use slog::{error, info, o, Logger};
use thiserror::Error;
use tokio::sync::{watch, Mutex};
use tokio_tungstenite::tungstenite::protocol::{Role, WebSocketConfig};
Expand Down Expand Up @@ -678,7 +678,8 @@ pub type Config = dropshot::ConfigDropshot;
/// the dropshot server itself
pub type Server = dropshot::HttpServer<Arc<Context>>;
/// errors returned from attempting to start a dropshot server
pub type ServerStartError = dropshot::GenericError;
// Dropshot should expose this, but it's going to be removed anyway.
pub type ServerStartError = Box<dyn std::error::Error + Send + Sync>;

/// Starts a Propolis mock server
pub async fn start(
Expand All @@ -688,6 +689,11 @@ pub async fn start(
let propolis_log = log.new(o!("component" => "propolis-server-mock"));
let dropshot_log = log.new(o!("component" => "dropshot"));
let private = Arc::new(Context::new(propolis_log));
dropshot::HttpServerStarter::new(&config, api(), private, &dropshot_log)?
.start()
let starter = dropshot::HttpServerStarter::new(
&config,
api(),
private,
&dropshot_log,
)?;
Ok(starter.start())
}

0 comments on commit 364413d

Please sign in to comment.