vtexpy 0.0.0b29__tar.gz → 0.0.0b30__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.
Potentially problematic release.
This version of vtexpy might be problematic. Click here for more details.
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/PKG-INFO +1 -1
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/pyproject.toml +1 -1
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/base.py +6 -31
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/orders.py +4 -4
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/payments_gateway.py +3 -1
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/LICENSE +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/README.md +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/__init__.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/__init__.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/catalog.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/checkout.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/custom.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/license_manager.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/logistics.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/master_data.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/pricing.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/promotions_and_taxes.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/types/__init__.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/types/catalog.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/types/generic.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_api/types/license_manager.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_config.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_constants.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_dto.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_exceptions.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_logging.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_sentinels.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_types.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_utils.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/_vtex.py +0 -0
- {vtexpy-0.0.0b29 → vtexpy-0.0.0b30}/vtex/py.typed +0 -0
|
@@ -126,26 +126,10 @@ class BaseAPI:
|
|
|
126
126
|
rate_limit
|
|
127
127
|
and rate_limit_key
|
|
128
128
|
and rate_limiter
|
|
129
|
-
and not rate_limiter.test(
|
|
130
|
-
rate_limit,
|
|
131
|
-
request_config.account_name,
|
|
132
|
-
rate_limit_key,
|
|
133
|
-
)
|
|
129
|
+
and not rate_limiter.test(rate_limit, rate_limit_key)
|
|
134
130
|
):
|
|
135
131
|
sleep(1)
|
|
136
|
-
self.logger.info(
|
|
137
|
-
f"{rate_limiter} limited {request_config.account_name} on "
|
|
138
|
-
f"{rate_limit_key}",
|
|
139
|
-
extra={
|
|
140
|
-
"account_name": request_config.account_name,
|
|
141
|
-
"rate_limit_key": rate_limit_key,
|
|
142
|
-
"remaining": rate_limiter.get_window_stats(
|
|
143
|
-
rate_limit,
|
|
144
|
-
request_config.account_name,
|
|
145
|
-
rate_limit_key,
|
|
146
|
-
).remaining,
|
|
147
|
-
},
|
|
148
|
-
)
|
|
132
|
+
self.logger.info(f"{rate_limiter} limited {rate_limit_key}")
|
|
149
133
|
|
|
150
134
|
try:
|
|
151
135
|
response = client.request(
|
|
@@ -161,22 +145,13 @@ class BaseAPI:
|
|
|
161
145
|
)
|
|
162
146
|
finally:
|
|
163
147
|
if rate_limit and rate_limit_key and rate_limiter:
|
|
164
|
-
rate_limiter.hit(
|
|
148
|
+
rate_limiter.hit(rate_limit, rate_limit_key)
|
|
149
|
+
remaining = rate_limiter.get_window_stats(
|
|
165
150
|
rate_limit,
|
|
166
|
-
request_config.account_name,
|
|
167
151
|
rate_limit_key,
|
|
168
|
-
)
|
|
152
|
+
).remaining
|
|
169
153
|
self.logger.info(
|
|
170
|
-
"
|
|
171
|
-
extra={
|
|
172
|
-
"account_name": request_config.account_name,
|
|
173
|
-
"rate_limit_key": rate_limit_key,
|
|
174
|
-
"remaining": rate_limiter.get_window_stats(
|
|
175
|
-
rate_limit,
|
|
176
|
-
request_config.account_name,
|
|
177
|
-
rate_limit_key,
|
|
178
|
-
).remaining,
|
|
179
|
-
},
|
|
154
|
+
f"Remaining requests for {rate_limit_key}: {remaining}",
|
|
180
155
|
)
|
|
181
156
|
|
|
182
157
|
response.request.headers = Headers(
|
|
@@ -89,7 +89,7 @@ class OrdersAPI(BaseAPI):
|
|
|
89
89
|
params=params,
|
|
90
90
|
config=self.client.config.with_overrides(**kwargs),
|
|
91
91
|
rate_limit=parse("4500 per minute"),
|
|
92
|
-
rate_limit_key="orders",
|
|
92
|
+
rate_limit_key=f"{self.client.config.account_name}:orders",
|
|
93
93
|
response_class=VTEXPaginatedItemsResponse[Any, Any],
|
|
94
94
|
)
|
|
95
95
|
|
|
@@ -106,7 +106,7 @@ class OrdersAPI(BaseAPI):
|
|
|
106
106
|
environment=self.ENVIRONMENT,
|
|
107
107
|
config=self.client.config.with_overrides(**kwargs),
|
|
108
108
|
rate_limit=parse("4500 per minute"),
|
|
109
|
-
rate_limit_key="orders",
|
|
109
|
+
rate_limit_key=f"{self.client.config.account_name}:orders",
|
|
110
110
|
response_class=VTEXDataResponse[Any],
|
|
111
111
|
)
|
|
112
112
|
|
|
@@ -127,7 +127,7 @@ class OrdersAPI(BaseAPI):
|
|
|
127
127
|
},
|
|
128
128
|
config=self.client.config.with_overrides(**kwargs),
|
|
129
129
|
rate_limit=parse("4500 per minute"),
|
|
130
|
-
rate_limit_key="orders",
|
|
130
|
+
rate_limit_key=f"{self.client.config.account_name}:orders",
|
|
131
131
|
response_class=VTEXItemsResponse[Any, Any],
|
|
132
132
|
)
|
|
133
133
|
|
|
@@ -153,6 +153,6 @@ class OrdersAPI(BaseAPI):
|
|
|
153
153
|
json={"handles": handles},
|
|
154
154
|
config=self.client.config.with_overrides(**kwargs),
|
|
155
155
|
rate_limit=parse("4500 per minute"),
|
|
156
|
-
rate_limit_key="orders",
|
|
156
|
+
rate_limit_key=f"{self.client.config.account_name}:orders",
|
|
157
157
|
response_class=VTEXDataResponse[Any],
|
|
158
158
|
)
|
|
@@ -38,7 +38,9 @@ class PaymentsGatewayAPI(BaseAPI):
|
|
|
38
38
|
environment=self.ENVIRONMENT,
|
|
39
39
|
config=self.client.config.with_overrides(**kwargs),
|
|
40
40
|
rate_limit=parse("3500 per minute"),
|
|
41
|
-
rate_limit_key=
|
|
41
|
+
rate_limit_key=(
|
|
42
|
+
f"{self.client.config.account_name}:transaction_interactions"
|
|
43
|
+
),
|
|
42
44
|
response_class=VTEXItemsResponse[Any, Any],
|
|
43
45
|
)
|
|
44
46
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|