Skip to content

Commit 271ba6e

Browse files
authored
Merge pull request #118 from OpenSemanticLab/dev
fix: apply ApiGateway httpx patch at module import time
2 parents 618130d + 7a6964b commit 271ba6e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/osw/utils/workflow.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@
2424
import osw.model.entity as model
2525
from osw.auth import CredentialManager
2626
from osw.core import OSW
27+
from osw.utils._httpx_gateway import _install as _install_gateway_hook
2728
from osw.utils.wiki import get_full_title
2829
from osw.wtsite import WtSite
2930

31+
# Auto-patch httpx at import time if PREFECT_API_URL is an ApiGateway URL.
32+
# This ensures the transport is active for ALL Prefect API calls, not just
33+
# those inside deploy(). The patch is lazy — no MW login until first request.
34+
_install_gateway_hook()
35+
3036

3137
# ------------------------------ CONNECTION ---------------------
3238
class ConnectionSettings(BaseModel):

0 commit comments

Comments
 (0)