Skip to content

Commit fb3a63e

Browse files
committed
feat: force delete all fly machines
Many times when we try to delete machines that are over-capacity we are not able to. It turns out that the delete API call does not always work even when a machine is already stopped. On Fly's advice we can force delete each time. Signed-off-by: Chris Goller <[email protected]>
1 parent 1e604cd commit fb3a63e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/fly/reconcile.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ async function reconcileMachine(state: V1Machine[], machine: GetDesiredStateResp
227227
await stopAndWait(current)
228228
} catch {} // stop can sometime fail, ignore.
229229
}
230-
const force = currentState === GetDesiredStateResponse_MachineState.ERROR
230+
// Always force delete to handle the situations when machines cannot be deleted for some reason in the Fly API.
231+
const force = true
231232
force ? console.log('Forcing delete of machine', current.id) : console.log('Deleting machine', current.id)
232233
await deleteMachine(current.id, force)
233234
}

0 commit comments

Comments
 (0)