Skip to content

Commit 64dd0ab

Browse files
committed
🐛 fix http webhook timeout
1 parent 18adb28 commit 64dd0ab

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/pylibob/connection.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def __init__(
322322
url: str,
323323
*,
324324
access_token: str | None = None,
325-
timeout: int = 5,
325+
timeout: int = 5000,
326326
) -> None:
327327
"""初始化 HTTP Webhook 连接。
328328
@@ -348,14 +348,13 @@ def _make_header(self) -> dict[str, str]:
348348

349349
async def emit_event(self, event: Event) -> None:
350350
async with ClientSession(
351-
timeout=self.timeout,
352351
headers=self._make_header(),
353352
) as session:
354353
event_json = event.dict()
355354
self.logger.debug(f"[SEND => {self.url}] {event_json}")
356355
async with session.post(
357356
self.url,
358-
timeout=ClientTimeout(total=self.timeout),
357+
timeout=ClientTimeout(total=self.timeout / 1000),
359358
json=event_json,
360359
) as resp:
361360
if resp.status == HTTP_204_NO_CONTENT:

0 commit comments

Comments
 (0)