We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18adb28 commit 64dd0abCopy full SHA for 64dd0ab
src/pylibob/connection.py
@@ -322,7 +322,7 @@ def __init__(
322
url: str,
323
*,
324
access_token: str | None = None,
325
- timeout: int = 5,
+ timeout: int = 5000,
326
) -> None:
327
"""初始化 HTTP Webhook 连接。
328
@@ -348,14 +348,13 @@ def _make_header(self) -> dict[str, str]:
348
349
async def emit_event(self, event: Event) -> None:
350
async with ClientSession(
351
- timeout=self.timeout,
352
headers=self._make_header(),
353
) as session:
354
event_json = event.dict()
355
self.logger.debug(f"[SEND => {self.url}] {event_json}")
356
async with session.post(
357
self.url,
358
- timeout=ClientTimeout(total=self.timeout),
+ timeout=ClientTimeout(total=self.timeout / 1000),
359
json=event_json,
360
) as resp:
361
if resp.status == HTTP_204_NO_CONTENT:
0 commit comments