mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-07 21:33:49 +00:00
Disable multi requests on timeout during multi-request (#1759)
_execute_multiple_query only disables batching on JSON_DECODE_FAIL_ERROR / INTERNAL_UNKNOWN_ERROR (#1025). This change applies the same pattern to a TimeoutError raised while sending a batch: set the batch size to 1 and raise _RetryableError. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -245,7 +245,16 @@ class SmartProtocol(BaseProtocol):
|
||||
batch_name,
|
||||
pf(smart_request),
|
||||
)
|
||||
response_step = await self._transport.send(smart_request)
|
||||
try:
|
||||
response_step = await self._transport.send(smart_request)
|
||||
except TimeoutError as ex:
|
||||
# P300 does not respond to some batched requests (e.g. both child
|
||||
# list requests together) so disable batching. Batch size is never
|
||||
# 1 here as that case sends single requests above.
|
||||
self._multi_request_batch_size = 1
|
||||
raise _RetryableError(
|
||||
"Timeout during multi request, multi requests disabled"
|
||||
) from ex
|
||||
if debug_enabled:
|
||||
if self._redact_data:
|
||||
data = redact_data(response_step, REDACTORS)
|
||||
|
||||
Reference in New Issue
Block a user