File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 6868 run : |
6969 kubectl rollout restart -n $BRANCH_NAME deployment/swift-server-app
7070 kubectl rollout restart -n $BRANCH_NAME deployment/swift-confirmation-server-app
71- kubectl rollout restart -n $BRANCH_NAME statefulset /swift-ws-server-app
71+ kubectl rollout restart -n $BRANCH_NAME deployment /swift-ws-server-app
Original file line number Diff line number Diff line change 6868 run : |
6969 kubectl rollout restart -n $BRANCH_NAME deployment/swift-server-app
7070 kubectl rollout restart -n $BRANCH_NAME deployment/swift-confirmation-server-app
71- kubectl rollout restart -n $BRANCH_NAME statefulset /swift-ws-server-app
71+ kubectl rollout restart -n $BRANCH_NAME deployment /swift-ws-server-app
Original file line number Diff line number Diff line change @@ -583,6 +583,22 @@ pub async fn health_check(
583583 true
584584 } ;
585585
586+ // Check if server has metadata available for all spot and perp markets
587+ let market_subs_healthy = server_params. drift . state_account ( ) . is_ok_and ( |s| {
588+ s. number_of_spot_markets
589+ == server_params
590+ . drift
591+ . program_data ( )
592+ . spot_market_configs ( )
593+ . len ( ) as u16
594+ && s. number_of_markets
595+ == server_params
596+ . drift
597+ . program_data ( )
598+ . perp_market_configs ( )
599+ . len ( ) as u16
600+ } ) ;
601+
586602 // Check if rpc is healthy
587603 let rpc_healthy = server_params. drift . rpc ( ) . get_health ( ) . await . is_ok ( ) ;
588604
@@ -591,13 +607,14 @@ pub async fn health_check(
591607 && user_account_fetcher_redis_health
592608 && redis_health
593609 && rpc_healthy
610+ && market_subs_healthy
594611 {
595612 ( axum:: http:: StatusCode :: OK , "ok" . into ( ) )
596613 } else {
597614 let msg = format ! (
598615 "slot_sub_healthy={slot_sub_healthy} | ws_sub_healthy={ws_healthy}
599616 | user_account_fetcher_healthy={user_account_fetcher_redis_health} |
600- redis_healthy={redis_health}|rpc_healthy={rpc_healthy}" ,
617+ redis_healthy={redis_health}|rpc_healthy={rpc_healthy}|market_subs={market_subs_healthy} " ,
601618 ) ;
602619 log:: error!( target: "server" , "Failed health check {}" , & msg) ;
603620 ( axum:: http:: StatusCode :: PRECONDITION_FAILED , msg)
You can’t perform that action at this time.
0 commit comments