Skip to content

Commit 72c45a0

Browse files
committed
fix: fix edge dc eligible calculation (#2567)
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
1 parent d632ace commit 72c45a0

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

packages/core/api/actor/src/utils.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,11 @@ pub fn filter_edge_dc(
4040
) -> GlobalResult<bool> {
4141
if config.server()?.rivet.has_multiple_server_types() {
4242
// Validate that the dc has a worker & guard so it can be contacted
43-
Ok(dc
44-
.pools
45-
.iter()
46-
.any(|x| x.pool_type == PoolType::Worker && x.desired_count > 0)
47-
&& dc
48-
.pools
49-
.iter()
50-
.any(|x| x.pool_type == PoolType::Guard && x.desired_count > 0))
43+
Ok(dc.pools.iter().any(|x| {
44+
x.pool_type == PoolType::Worker && x.desired_count.max(x.min_count).min(x.max_count) > 0
45+
}) && dc.pools.iter().any(|x| {
46+
x.pool_type == PoolType::Guard && x.desired_count.max(x.min_count).min(x.max_count) > 0
47+
}))
5148
} else {
5249
// All DC are valid
5350
Ok(true)

0 commit comments

Comments
 (0)