Skip to content

Commit

Permalink
Only load the application in the main process if the reloader is bein…
Browse files Browse the repository at this point in the history
…g used.
  • Loading branch information
mitchej123 authored and pgjones committed Oct 28, 2023
1 parent 96e3fce commit 42ac5db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hypercorn/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ def run(config: Config) -> None:

sockets = config.create_sockets()

# Load the application so that the correct paths are checked for
# changes.
load_application(config.application_path, config.wsgi_max_body_size)
if config.use_reloader:
# Load the application so that the correct paths are checked for
# changes, but only when the reloader is being used.
load_application(config.application_path, config.wsgi_max_body_size)

ctx = get_context("spawn")

Expand Down

0 comments on commit 42ac5db

Please sign in to comment.