Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sanic-org/sanic into http3
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Jun 16, 2022
2 parents 0e85218 + 65b53a5 commit 171dabb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sanic/server/protocols/http_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
if TYPE_CHECKING: # no cov
from sanic.app import Sanic

import sys

from asyncio import CancelledError
from time import monotonic as current_time

Expand Down Expand Up @@ -187,7 +189,10 @@ def check_timeouts(self):
)
self.loop.call_later(max(0.1, interval), self.check_timeouts)
return
self._task.cancel()
cancel_msg_args = ()
if sys.version_info >= (3, 9):
cancel_msg_args = ("Cancel connection task with a timeout",)
self._task.cancel(*cancel_msg_args)
except Exception:
error_logger.exception("protocol.check_timeouts")

Expand Down

0 comments on commit 171dabb

Please sign in to comment.