4

I have a flask app that needs a minute to spin up, but then should respond snappily. Currently I am using gunicorn -t 90 (as discussed in Running Gunicorn Flask app in Docker [CRITICAL] WORKER TIMEOUT when starting up) to avoid the app being killed, however it will also affect the timeout after the initialisation. Is there any way to make this more fine-grained? Some way to loosen the timeout setting till the app signals that the initialisation is done? Or tighten it when the import of the app is done?

Amadan
  • 191,408
  • 23
  • 240
  • 301

1 Answers1

2

You could try setting preload_app=True or move your initialization to on_startup in your gunicorn_conf.py.

pypae
  • 639
  • 6
  • 16