Skip to content

Commit 0146af1

Browse files
committed
fix: fix default datacenter id for builds
1 parent 486ac72 commit 0146af1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/core/api/actor/src/route/builds.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ pub async fn complete_build(
428428
_body: serde_json::Value,
429429
query: GlobalQuery,
430430
) -> GlobalResult<serde_json::Value> {
431-
let CheckOutput { env_id, .. } = ctx
431+
let CheckOutput { game_id, env_id } = ctx
432432
.auth()
433433
.check(
434434
ctx.op_ctx(),
@@ -460,11 +460,16 @@ pub async fn complete_build(
460460

461461
// Prewarm all datacenters for pegboard
462462
{
463-
let default_cluster_id = ctx.config().server()?.rivet.default_cluster_id()?;
463+
let clusters_res = ctx
464+
.op(cluster::ops::get_for_game::Input {
465+
game_ids: vec![game_id],
466+
})
467+
.await?;
468+
let cluster_id = unwrap!(clusters_res.games.first()).cluster_id;
464469

465470
let datacenters_res = ctx
466471
.op(cluster::ops::datacenter::list::Input {
467-
cluster_ids: vec![default_cluster_id],
472+
cluster_ids: vec![cluster_id],
468473
})
469474
.await?;
470475
let cluster = unwrap!(datacenters_res.clusters.into_iter().next());

0 commit comments

Comments
 (0)