wcp-library 1.6.4__tar.gz → 1.6.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wcp_library-1.6.4 → wcp_library-1.6.5}/PKG-INFO +1 -1
- {wcp_library-1.6.4 → wcp_library-1.6.5}/pyproject.toml +1 -1
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/__init__.py +22 -28
- {wcp_library-1.6.4 → wcp_library-1.6.5}/README.md +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/browser_automation/__init__.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/browser_automation/browser.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/browser_automation/interactions.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/__init__.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/_credential_manager_asynchronous.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/_credential_manager_synchronous.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/api.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/ftp.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/internet.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/oracle.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/postgres.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/emailing.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/ftp/__init__.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/ftp/ftp.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/ftp/sftp.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/informatica.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/logging.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/selenium/__init__.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/selenium/_selenium_driver.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/selenium/selenium_helper.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/sql/__init__.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/sql/oracle.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/sql/postgres.py +0 -0
- {wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/time.py +0 -0
@@ -42,24 +42,21 @@ def divide_chunks(list_obj: list, size: int) -> Generator:
|
|
42
42
|
|
43
43
|
|
44
44
|
def retry(
|
45
|
-
|
45
|
+
exceptions: tuple[Type[Exception]],
|
46
46
|
max_attempts: Optional[int] = MAX_ATTEMPTS,
|
47
47
|
delay: Optional[int] = DELAY,
|
48
48
|
backoff: Optional[int] = BACKOFF,
|
49
49
|
jitter: Optional[int] = JITTER,
|
50
50
|
) -> Callable:
|
51
|
-
"""
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
Returns:
|
62
|
-
Callable: The decorated function with retry logic.
|
51
|
+
"""
|
52
|
+
Decorator to retry a synchronous function on a specified exception with exponential backoff and jitter.
|
53
|
+
|
54
|
+
:param exceptions: Tuple of exception types to catch and retry on.
|
55
|
+
:param max_attempts: Maximum number of retry attempts.
|
56
|
+
:param delay: Initial delay between retries (in seconds).
|
57
|
+
:param backoff: Multiplier to increase delay after each failure.
|
58
|
+
:param jitter: Maximum number of seconds to add randomly to each delay.
|
59
|
+
:return: The decorated function with retry logic.
|
63
60
|
"""
|
64
61
|
|
65
62
|
def decorator(func: Callable) -> Callable:
|
@@ -70,7 +67,7 @@ def retry(
|
|
70
67
|
for attempt in range(0, max_attempts):
|
71
68
|
try:
|
72
69
|
return func(*args, **kwargs)
|
73
|
-
except
|
70
|
+
except exceptions as error:
|
74
71
|
if attempt == max_attempts:
|
75
72
|
logger.error("Retry failed after %d attempts.", max_attempts)
|
76
73
|
raise
|
@@ -90,24 +87,21 @@ def retry(
|
|
90
87
|
|
91
88
|
|
92
89
|
def async_retry(
|
93
|
-
|
90
|
+
exceptions: tuple[Type[Exception]],
|
94
91
|
max_attempts: Optional[int] = MAX_ATTEMPTS,
|
95
92
|
delay: Optional[int] = DELAY,
|
96
93
|
backoff: Optional[int] = BACKOFF,
|
97
94
|
jitter: Optional[int] = JITTER,
|
98
95
|
) -> Callable:
|
99
|
-
"""
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
Returns:
|
110
|
-
Callable: The decorated async function with retry logic.
|
96
|
+
"""
|
97
|
+
Decorator to retry an async function on a specified exception with exponential backoff and jitter.
|
98
|
+
|
99
|
+
:param exceptions: Tuple of exception types to catch and retry on.
|
100
|
+
:param max_attempts: Maximum number of retry attempts.
|
101
|
+
:param delay: Initial delay between retries (in seconds).
|
102
|
+
:param backoff: Multiplier to increase delay after each failure.
|
103
|
+
:param jitter: Maximum number of seconds to add randomly to each delay.
|
104
|
+
:return: The decorated async function with retry logic.
|
111
105
|
"""
|
112
106
|
|
113
107
|
def decorator(func: Callable) -> Callable:
|
@@ -118,7 +112,7 @@ def async_retry(
|
|
118
112
|
for attempt in range(0, max_attempts):
|
119
113
|
try:
|
120
114
|
return await func(*args, **kwargs)
|
121
|
-
except
|
115
|
+
except exceptions as error:
|
122
116
|
if attempt == max_attempts:
|
123
117
|
logger.error("Retry failed after %d attempts.", max_attempts)
|
124
118
|
raise
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/_credential_manager_asynchronous.py
RENAMED
File without changes
|
{wcp_library-1.6.4 → wcp_library-1.6.5}/wcp_library/credentials/_credential_manager_synchronous.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|