Skip to content

Commit 19fd799

Browse files
committed
Review auto runtime-mode option
1 parent 8a55b5e commit 19fd799

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

granian/server/common.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,13 @@ def serve(
677677

678678
if self.runtime_mode == RuntimeModes.auto:
679679
self.runtime_mode = RuntimeModes.st
680-
if self.interface == Interfaces.WSGI:
681-
self.runtime_mode = RuntimeModes.mt
682-
if self.http == HTTPModes.http2:
680+
if any(
681+
[
682+
self.interface != Interfaces.RSGI,
683+
self.runtime_threads > 1,
684+
self.http == HTTPModes.http2,
685+
]
686+
):
683687
self.runtime_mode = RuntimeModes.mt
684688

685689
if self.task_impl == TaskImpl.rust:

0 commit comments

Comments
 (0)