Skip to content

Commit c639ff4

Browse files
authored
Don't enable gunicorn's preload_app in development (#249)
Since otherwise it interferes with `reload = True`. See: https://docs.gunicorn.org/en/stable/settings.html#reload GUS-W-17614098.
1 parent 6d60400 commit c639ff4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gunicorn.conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
# Each `gthread` worker process will use a pool of this many threads.
3939
threads = 5
4040

41-
# Load the app before the worker processes are forked, to reduce memory usage and boot times.
42-
preload_app = True
43-
4441
# Workers silent for more than this many seconds are killed and restarted.
4542
# Note: This only affects the maximum request time when using the `sync` worker.
4643
# For all other worker types it acts only as a worker heartbeat timeout.
@@ -63,6 +60,10 @@
6360
# Automatically restart gunicorn when the app source changes in development.
6461
reload = True
6562
else:
63+
# Load the app before the worker processes are forked, to reduce memory usage and boot times.
64+
# We don't enable this in development, since it's incompatible with `reload = True`.
65+
preload_app = True
66+
6667
# Use `SO_REUSEPORT` on the listening socket, which allows for more even request
6768
# distribution between workers. See: https://lwn.net/Articles/542629/
6869
# We don't enable this in development, since it makes it harder to notice when

0 commit comments

Comments
 (0)