mirror of
https://github.com/django/daphne.git
synced 2025-07-29 16:39:46 +03:00
Modify code style
This commit is contained in:
parent
13abad2f89
commit
c57252a9fc
|
@ -126,9 +126,11 @@ class DaphneProcess(multiprocessing.Process):
|
||||||
# This is necessary because asyncio behaves badly with multiprocessing.
|
# This is necessary because asyncio behaves badly with multiprocessing.
|
||||||
from twisted.internet import asyncioreactor
|
from twisted.internet import asyncioreactor
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
current_reactor = sys.modules.get("twisted.internet.reactor")
|
current_reactor = sys.modules.get("twisted.internet.reactor")
|
||||||
if isinstance(current_reactor, asyncioreactor.AsyncioSelectorReactor):
|
if isinstance(current_reactor, asyncioreactor.AsyncioSelectorReactor):
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
current_reactor._asyncioEventloop.close()
|
current_reactor._asyncioEventloop.close()
|
||||||
asyncio.set_event_loop(asyncio.new_event_loop())
|
asyncio.set_event_loop(asyncio.new_event_loop())
|
||||||
current_reactor._asyncioEventloop = asyncio.get_event_loop()
|
current_reactor._asyncioEventloop = asyncio.get_event_loop()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user