Skip to content

Commit

Permalink
main: close application State after Server exits
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbronder committed Feb 6, 2024
1 parent 2b3662b commit 488f43c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ async fn main() {

let app = axum::Router::new()
.route("/github/events", post(post_github_events))
.with_state(state);
.with_state(state.clone());

axum::Server::bind(&"0.0.0.0:3333".parse().unwrap())
.serve(app.into_make_service())
.with_graceful_shutdown(shutdown_signal())
.await
.unwrap();

state.close().await;
}

0 comments on commit 488f43c

Please sign in to comment.