Skip to content

Commit

Permalink
go back to helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakekaplan committed Sep 6, 2024
1 parent 73687fd commit 9ab7820
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/prefect/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
from prefect.client.orchestration import PrefectClient, SyncPrefectClient, get_client
from prefect.client.schemas import FlowRun, TaskRun
from prefect.events.clients import (
araise_for_events_connection_error,
raise_for_events_connection_error,
sync_raise_for_events_connection_error,
)
from prefect.events.worker import EventsWorker
from prefect.exceptions import MissingContextError
Expand Down Expand Up @@ -215,7 +215,7 @@ def __enter__(self):
if self._context_stack == 1:
self.client.__enter__()
self.client.raise_for_api_version_mismatch()
sync_raise_for_events_connection_error()
raise_for_events_connection_error()
return super().__enter__()
else:
return self
Expand Down Expand Up @@ -274,7 +274,7 @@ async def __aenter__(self):
if self._context_stack == 1:
await self.client.__aenter__()
await self.client.raise_for_api_version_mismatch()
await raise_for_events_connection_error()
await araise_for_events_connection_error()
return super().__enter__()
else:
return self
Expand Down
4 changes: 2 additions & 2 deletions src/prefect/events/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _get_socket_url_and_headers():
return events_in_socket_from_api_url(api_url), headers


def sync_raise_for_events_connection_error():
def raise_for_events_connection_error():
socket_url, headers = _get_socket_url_and_headers()

try:
Expand All @@ -177,7 +177,7 @@ def sync_raise_for_events_connection_error():
) from e


async def raise_for_events_connection_error():
async def araise_for_events_connection_error():
socket_url, headers = _get_socket_url_and_headers()

try:
Expand Down

0 comments on commit 9ab7820

Please sign in to comment.