mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
aiohttp 2.3.1 dependency
This commit is contained in:
1 parent
8fcfed53ed
commit
a7412d1c87
3 files changed
+16
-5
No files matched your search
@@ -43,8 +43,8 @@ import gns3server.handlers
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
if not aiohttp.__version__.startswith("2.2"):
|
||||
raise RuntimeError("aiohttp 2.2 is required to run the GNS3 server")
|
||||
if not (aiohttp.__version__.startswith("2.2") or aiohttp.__version__.startswith("2.3")):
|
||||
raise RuntimeError("aiohttp 2.2.x or 2.3.x is required to run the GNS3 server")
|
||||
|
||||
|
||||
class WebServer:
|
||||
@@ -102,7 +102,12 @@ class WebServer:
|
||||
if self._app:
|
||||
yield from self._app.shutdown()
|
||||
if self._handler:
|
||||
yield from self._handler.finish_connections(2) # Parameter is timeout
|
||||
try:
|
||||
# aiohttp < 2.3
|
||||
yield from self._handler.finish_connections(2) # Parameter is timeout
|
||||
except AttributeError:
|
||||
# aiohttp >= 2.3
|
||||
yield from self._handler.shutdown(2) # Parameter is timeout
|
||||
if self._app:
|
||||
yield from self._app.cleanup()
|
||||
|
||||
|
||||
Reference in new issue
Block a user