diff --git a/services/api/src/endpoints/private.rs b/services/api/src/endpoints/private.rs index 95da5041..f274c89a 100644 --- a/services/api/src/endpoints/private.rs +++ b/services/api/src/endpoints/private.rs @@ -14,7 +14,7 @@ struct ClusterStats { } pub async fn discord_state(State(ctx): State) -> Json { - let shard_status = ctx + let mut shard_status = ctx .redis .hgetall::, &str>("pluralkit:shardstatus") .await @@ -23,6 +23,8 @@ pub async fn discord_state(State(ctx): State) -> Json { .map(|v| serde_json::from_str(v).expect("could not deserialize shard")) .collect::>(); + shard_status.sort_by(|a, b| a.shard_id.cmp(&b.shard_id)); + Json(json!({ "shards": shard_status, }))