Does anyone know of a scale to 0 python/flask server example? Fly specific or even maybe generic example would be helpful.
I’m not as familiar with the python ecosystem but need to run some very python specific code, so something like ‘gracefully shut a flask server down if it hasn’t received requests in the last 5 minutes’ has proven somewhat non-trivial.
We run a node app where we try to gracefully shut it all down, and you’re right, it isn’t straight-forward (commit). Perhaps, a fly.toml entry for sigint_idle_threshold = 300s would be nice to have out of the box.