Fix DC uptime always showing 100% despite rack failures
CI / build-and-push (push) Successful in 34s
CI / build-and-push (push) Successful in 34s
Failed racks were removed from dc.racks in Phase 3 before uptime was calculated in Phase 4, so healthyCount always equaled totalInDc. Now counts racks in the repair pipeline as down capacity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -238,8 +238,9 @@ export function processInfrastructure(state: GameState): InfraTickResult {
|
|||||||
|
|
||||||
let dcFlops = 0;
|
let dcFlops = 0;
|
||||||
let usedPowerKW = 0;
|
let usedPowerKW = 0;
|
||||||
|
const repairingForDc = rackPipeline.filter(o => o.dataCenterId === dc.id && o.stage === 'repair').length;
|
||||||
const healthyCount = dc.racks.length;
|
const healthyCount = dc.racks.length;
|
||||||
const totalInDc = dc.racks.length;
|
const totalInDc = dc.racks.length + repairingForDc;
|
||||||
|
|
||||||
for (const rack of dc.racks) {
|
for (const rack of dc.racks) {
|
||||||
const sku = RACK_SKU_CONFIGS[rack.skuId];
|
const sku = RACK_SKU_CONFIGS[rack.skuId];
|
||||||
|
|||||||
Reference in New Issue
Block a user