Skip to content

Commit 440b5b7

Browse files
committed
fix(events): cast backend_shutdown result to Awaitable for proper async handling
1 parent 94b4d9c commit 440b5b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sqlspec/extensions/events/channel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import inspect
66
import threading
77
import uuid
8-
from collections.abc import AsyncIterator, Iterator
8+
from collections.abc import AsyncIterator, Awaitable, Iterator
99
from dataclasses import dataclass
10-
from typing import TYPE_CHECKING, Any
10+
from typing import TYPE_CHECKING, Any, cast
1111

1212
from sqlspec.exceptions import ImproperConfigurationError, MissingDependencyError
1313
from sqlspec.extensions.events._hints import get_runtime_hints
@@ -626,7 +626,7 @@ async def shutdown_async(self) -> None:
626626
if backend_shutdown is not None and callable(backend_shutdown):
627627
result = backend_shutdown()
628628
if result is not None:
629-
await result
629+
await cast("Awaitable[None]", result)
630630
except Exception as error:
631631
self._end_event_span(span, error=error)
632632
raise

0 commit comments

Comments
 (0)