Skip to content

Commit ac06d5c

Browse files
authored
Merge pull request #104 from drift-labs/master
mainnet-beta ship
2 parents 0be075a + 6ec2109 commit ac06d5c

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

.github/workflows/mainnet-beta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ jobs:
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

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ jobs:
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

src/swift_server.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)