Skip to content

Commit 9734403

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 9734403

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
from posthog.utils import remove_trailing_slash
1212
from posthog.version import VERSION
1313

14+
adapter = requsts.adapters.HTTPAdapter(max_retries=2)
1415
_session = requests.sessions.Session()
16+
_session.mount("https://", adapter)
1517

1618
US_INGESTION_ENDPOINT = "https://us.i.posthog.com"
1719
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)