Skip to content

Commit 0e87219

Browse files
committed
automatically retry connection errors
from the docs for max_retries: this applies only to failed DNS lookups, socket connections and connection timeouts
1 parent 38683e8 commit 0e87219

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.13.0 - 2025-02-12
2+
3+
1. Automatically retry connection errors
4+
15
## 3.12.1 - 2025-02-11
26

37
1. Fix mypy support for 3.12.0

posthog/request.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
from typing import Any, Optional, Union
77

88
import requests
9+
from requests.adapters import HTTPAdapter
910
from dateutil.tz import tzutc
1011

1112
from posthog.utils import remove_trailing_slash
1213
from posthog.version import VERSION
1314

15+
adapter = HTTPAdapter(max_retries=2)
1416
_session = requests.sessions.Session()
17+
_session.mount('https://', adapter)
1518

1619
US_INGESTION_ENDPOINT = "https://us.i.posthog.com"
1720
EU_INGESTION_ENDPOINT = "https://eu.i.posthog.com"

posthog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "3.12.1"
1+
VERSION = "3.13.0"
22

33
if __name__ == "__main__":
44
print(VERSION, end="") # noqa: T201

0 commit comments

Comments
 (0)