|
|
|
@ -21,18 +21,15 @@ const DeploymentStatus = { |
|
|
|
// checks that deployments are in a good state, any pending will be updated
|
|
|
|
async function checkAllDeployments(deployments) { |
|
|
|
let updated = false |
|
|
|
function update(deployment, status) { |
|
|
|
deployment.status = status |
|
|
|
updated = true |
|
|
|
} |
|
|
|
|
|
|
|
for (let deployment of Object.values(deployments.history)) { |
|
|
|
// check that no deployments have crashed etc and are now stuck
|
|
|
|
if ( |
|
|
|
deployment.status === DeploymentStatus.PENDING && |
|
|
|
Date.now() - deployment.updatedAt > MAX_PENDING_TIME_MS |
|
|
|
) { |
|
|
|
update(deployment, DeploymentStatus.FAILURE) |
|
|
|
deployment.status = status |
|
|
|
deployment.err = "Timed out" |
|
|
|
updated = true |
|
|
|
} |
|
|
|
} |
|
|
|
return { updated, deployments } |
|
|
|
|