mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Start only one worker with the nothreading option. (#298)
Reuse the nothreading option of the runserver command to only start one worker.
This commit is contained in:
parent
fb2e9320c2
commit
32568dc879
|
@ -65,7 +65,8 @@ class Command(RunserverCommand):
|
|||
|
||||
# Launch workers as subthreads
|
||||
if options.get("run_worker", True):
|
||||
for _ in range(4):
|
||||
worker_count = 4 if options.get("use_threading", True) else 1
|
||||
for _ in range(worker_count):
|
||||
worker = WorkerThread(self.channel_layer, self.logger)
|
||||
worker.daemon = True
|
||||
worker.start()
|
||||
|
|
Loading…
Reference in New Issue
Block a user