diff --git a/gateway/src/main.rs b/gateway/src/main.rs index c457ed83..1afaef4f 100644 --- a/gateway/src/main.rs +++ b/gateway/src/main.rs @@ -81,7 +81,7 @@ async fn init_gateway( if shard_count < 16 { scheme = ShardScheme::Auto; } else { - let cluster_id = env::var("NOMAD_ALLOC_INDEX")?.parse::().unwrap(); + let cluster_id = env::var("NOMAD_ALLOC_INDEX").or("0").parse::().unwrap(); let first_shard_id = 16 * cluster_id; scheme = ShardScheme::try_from((first_shard_id..first_shard_id+16, shard_count)).unwrap();