Is there an easy way to implement tokio graceful shutdown?

55 points NigraOvis 27 comments

I am trying to get an axum server, to wait for my db writes when i either hit ctrl+c OR the service i am running is shut down

so i need ctrl+c and sigterm to both gracefully shut down..

not everything matters. but anytime i have a .route("path", get(function) run - the function isn't always important. but some of them write database information,a nd i need to ensure that database info is writen before closing.