Skip to content

Commit

Permalink
Merge pull request #65 from depot/log-ids
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie authored Sep 22, 2023
2 parents 617016e + e76d50e commit 57d9fa5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,22 +350,22 @@ async function reconcileMachine(state: Record<string, Instance>, machine: GetDes
if (machine.desiredState === GetDesiredStateResponse_MachineState.RUNNING) {
if (currentState === GetDesiredStateResponse_MachineState.PENDING) return
if (currentState === GetDesiredStateResponse_MachineState.DELETED) return
console.log(`Starting instance ${current.InstanceId}`)
console.log(`Starting instance ${machine.id} (${current.InstanceId})`)
await client.send(new StartInstancesCommand({InstanceIds: [current.InstanceId]}))
}

if (machine.desiredState === GetDesiredStateResponse_MachineState.STOPPED) {
if (currentState === GetDesiredStateResponse_MachineState.PENDING) return
if (currentState === GetDesiredStateResponse_MachineState.DELETED) return
if (currentState === GetDesiredStateResponse_MachineState.STOPPING) return
console.log(`Stopping instance ${current.InstanceId}`)
console.log(`Stopping instance ${machine.id} (${current.InstanceId})`)
await client.send(new StopInstancesCommand({InstanceIds: [current.InstanceId]}))
}

if (machine.desiredState === GetDesiredStateResponse_MachineState.DELETED) {
if (currentState === GetDesiredStateResponse_MachineState.PENDING) return
if (currentState === GetDesiredStateResponse_MachineState.DELETING) return
console.log(`Terminating instance ${current.InstanceId}`)
console.log(`Terminating instance ${machine.id} (${current.InstanceId})`)
await client.send(new TerminateInstancesCommand({InstanceIds: [current.InstanceId]}))
}
}
Expand Down

0 comments on commit 57d9fa5

Please sign in to comment.