Skip to content

Commit 6c5abe5

Browse files
committed
refactor: add retry mechanism in GET and POST network calls, if any fails
1 parent ce48cf2 commit 6c5abe5

22 files changed

Lines changed: 224 additions & 107 deletions

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.10.0] - 2025-07-02
8+
9+
### Added
10+
11+
- Added exponential backoff retry mechanism for failed network requests. This improves reliability by automatically retrying failed requests with increasing delays between attempts.
12+
713
## [1.9.1] - 2025-05-07
814

915
### Added
@@ -15,15 +21,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1521
### Added
1622

1723
- Added support for `batch_event_data` configuration to optimize network requests by batching multiple events together. This allows you to:
18-
24+
1925
- Configure `request_time_interval` to flush events after a specified time interval
2026
- Set `events_per_request` to control maximum events per batch
2127
- Implement `flush_callback` to handle batch processing results
2228
- Manually trigger event flushing via `flush_events()` method
2329

2430
```python
2531
from vwo import init
26-
32+
2733
def event_flush_callback(error, payload):
2834
# your implementation here
2935

@@ -238,4 +244,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
238244
}
239245

240246
vwo_client = init(options)
241-
```
247+
```

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def run(self):
121121

122122
setup(
123123
name="vwo-fme-python-sdk",
124-
version="1.9.1",
124+
version="1.10.0",
125125
description="VWO Feature Management and Experimentation SDK for Python",
126126
long_description=long_description,
127127
long_description_content_type="text/markdown",

vwo/api/set_attribute_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ def create_and_send_impression_for_attribute(
6060
vwo_instance.batch_event_queue.enqueue(payload)
6161
else:
6262
# Send the event immediately if batch events are not enabled
63-
send_post_api_request(properties, payload)
63+
send_post_api_request(properties, payload, context.get_id())

vwo/api/track_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ def create_and_send_impression_for_track(
102102
vwo_instance.batch_event_queue.enqueue(payload)
103103
else:
104104
# Send the event immediately if batch events are not enabled
105-
send_post_api_request(properties, payload)
105+
send_post_api_request(properties, payload, context.get_id())

vwo/constants/Constants.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Constants:
1717
# TODO: read from setup.py
1818
package_file = {
1919
"name": "vwo-fme-python-sdk",
20-
"version": "1.9.1"
20+
"version": "1.10.0"
2121
}
2222

2323
# Constants
@@ -59,3 +59,6 @@ class Constants:
5959

6060
THREAD_POOL_MAX_WORKERS = 5
6161
SHOULD_USE_THREADING = True
62+
63+
MAX_RETRIES = 3
64+
INITIAL_WAIT_TIME = 2

vwo/enums/event_enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
class EventEnum(Enum):
2020
VWO_VARIATION_SHOWN = "vwo_variationShown"
2121
VWO_SYNC_VISITOR_PROP = "vwo_syncVisitorProp"
22-
VWO_LOG_EVENT = "vwo_log"
22+
VWO_LOG_EVENT = "vwo_log"

vwo/models/campaign/campaign_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ def set_end_range_variation(self, end_range_variation: float) -> None:
137137
self._end_range_variation = end_range_variation
138138

139139
def get_salt(self) -> str:
140-
return self._salt
140+
return self._salt

vwo/models/campaign/variation_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ def set_key(self, key: str) -> None:
101101
self._key = key
102102

103103
def get_salt(self) -> str:
104-
return self._salt
104+
return self._salt

vwo/models/settings/settings_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ def set_poll_interval(self, value: int):
8888
self._poll_interval = value
8989

9090
def get_poll_interval(self) -> int:
91-
return self._poll_interval
91+
return self._poll_interval

vwo/packages/logger/core/log_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from ....constants.Constants import Constants
2626

2727

28+
2829
class LogManager(Logger):
2930
_instance = None
3031
stored_messages = (

0 commit comments

Comments
 (0)