Seems like the default machine restart policy is “no”, I want to change it to “always”. I went to this thread and changed my fly.toml to set the restart policy but it seems like every machine created for my project has a restart policy set to “no”. How do I actually change the policy? Changing my fly.toml file does nothing.
Here’s the entire config in case it matters:
app = 'rtr'
primary_region = 'bog'
[build]
[deploy]
release_command = 'python main.py'
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[services]]
protocol = 'tcp'
internal_port = 8080
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 1
[[services.ports]]
port = 8080
handlers = ['tcp']
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
[[restart]]
policy = "always"
retries = 10
processes = ["app"]
I have tried to execute fly machine update [MACHINE_ID] --restart always
, but I get this error:
Error: could not update machine : failed to update VM : invalid_argument: unable to update machine configured for auto destroy
But I do not want to configure the machine for auto destroy, and as far as I know, there’s nothing in my fly.toml file that suggests that I want auto destroy for my machines, I’m not sure what to do here
UPDATE: When I deploy using fly m run .
instead of fly deploy
it sets the correct restart policy, not sure if there’s a way to configure it using fly deploy
though so I’ll leave this open