Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Karl committed Feb 7, 2024
1 parent 769de28 commit 1eff5ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
12 changes: 7 additions & 5 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ fn set_loglevel(opt: &BaseOptions) -> Result<(), tracing::dispatcher::SetGlobalD
pub async fn client_start(start_opts: ClientStartCommand) -> anyhow::Result<()> {
set_loglevel(&start_opts.base)?;
Toplevel::new(|s| async move {
s.start(SubsystemBuilder::new("Eventloop", |subsys| event_loop(subsys, start_opts)));
})
.catch_signals()
.handle_shutdown_requests(Duration::from_millis(1000))
.await?;
s.start(SubsystemBuilder::new("Eventloop", |subsys| {
event_loop(subsys, start_opts)
}));
})
.catch_signals()
.handle_shutdown_requests(Duration::from_millis(1000))
.await?;
Ok(())
}

Expand Down
16 changes: 8 additions & 8 deletions src/server/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::cli::{
use crate::server::protocol::WirespiderServerState;

use anyhow::Context;
use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle};
use tokio_graceful_shutdown::Toplevel;
use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle};
use tracing::metadata::LevelFilter;
use tracing_error::ErrorLayer;
use tracing_subscriber::prelude::*;
Expand Down Expand Up @@ -50,13 +50,13 @@ pub async fn server_run(opt: ServerRunCommand) -> anyhow::Result<()> {
debug!("Starting");

Toplevel::new(move |s| async move {
s.start(SubsystemBuilder::new("TonicService", move |handle| {
tonic_service(handle, opt.bind)
}));
})
.catch_signals()
.handle_shutdown_requests(Duration::from_millis(1000))
.await?;
s.start(SubsystemBuilder::new("TonicService", move |handle| {
tonic_service(handle, opt.bind)
}));
})
.catch_signals()
.handle_shutdown_requests(Duration::from_millis(1000))
.await?;
Ok(())
}

Expand Down

0 comments on commit 1eff5ea

Please sign in to comment.