Skip to content

Commit

Permalink
log if multiple instances with the same machine ID are found
Browse files Browse the repository at this point in the history
this should help us make sure that the duplicate machine bug is properly squashed
  • Loading branch information
billyb2 committed Nov 7, 2024
1 parent c3f07ed commit d45ad57
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ async function runInstance(machine: GetDesiredStateResponse_NewMachine, subnetID
}),
)
const instances = res.Reservations?.flatMap((r) => r.Instances || []) || []
if (instances.length > 1) {
console.log(`Multiple instances with the same machine-id! ${machine.id}`)
}
if (instances.length > 0) {
console.log(`Found existing ${instances.length} instances for machine ID ${machine.id}, skipping`)
return
Expand Down

0 comments on commit d45ad57

Please sign in to comment.