mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 01:57:45 +08:00 
			
		
		
		
	feat: add deep health check for drainer (#3396)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: dracarys18 <karthikey.hegde@juspay.in>
This commit is contained in:
		| @ -1,4 +1,7 @@ | ||||
| use drainer::{errors::DrainerResult, logger::logger, services, settings, start_drainer}; | ||||
| use drainer::{ | ||||
|     errors::DrainerResult, logger::logger, services, settings, start_drainer, start_web_server, | ||||
| }; | ||||
| use router_env::tracing::Instrument; | ||||
|  | ||||
| #[tokio::main] | ||||
| async fn main() -> DrainerResult<()> { | ||||
| @ -24,6 +27,19 @@ async fn main() -> DrainerResult<()> { | ||||
|         [router_env::service_name!()], | ||||
|     ); | ||||
|  | ||||
|     #[allow(clippy::expect_used)] | ||||
|     let web_server = Box::pin(start_web_server(conf.clone(), store.clone())) | ||||
|         .await | ||||
|         .expect("Failed to create the server"); | ||||
|  | ||||
|     tokio::spawn( | ||||
|         async move { | ||||
|             let _ = web_server.await; | ||||
|             logger::error!("The health check probe stopped working!"); | ||||
|         } | ||||
|         .in_current_span(), | ||||
|     ); | ||||
|  | ||||
|     logger::debug!(startup_config=?conf); | ||||
|     logger::info!("Drainer started [{:?}] [{:?}]", conf.drainer, conf.log); | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Chethan Rao
					Chethan Rao