Fly app console machines does not allways close

I spin up extra machines to deploy migrations either on a release:

[deploy]
  release_command = "npx prisma migrate deploy"

or when I load data from prod. I run the following script in a terminal:

fly console -a {service_name} -C "npx prisma migrate deploy

Sometimes the script is stopped or it fails. So what I have observed is that the machines are not closed down.

Here I have uploaded a screen shot where you can see a console machine that has been for 10 days. So would like to know how to automatically clean these up. Either by running the commands differently or by given a script that can kill all machines running fly_app.console which I can set up to run every night as a cron job.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.