check the status of socket before shutting down (#2680)

* check the status of socket before shutting down

* remove socket status checking & ignore OSError exception
This commit is contained in:
Mohammad Almoghrabi 2023-02-14 22:59:41 +02:00 committed by GitHub
parent 5e7f6998bd
commit 6f5303e080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -877,7 +877,10 @@ class StartupMixin(metaclass=SanicMeta):
sync_manager.shutdown()
for sock in socks:
sock.shutdown(SHUT_RDWR)
try:
sock.shutdown(SHUT_RDWR)
except OSError:
...
sock.close()
socks = []
trigger_events(main_stop, loop, primary)