Skip to content

Commit 62b515e

Browse files
committed
Fix external URL upload retry loop
1 parent e0baf7c commit 62b515e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mautrix/client/api/modules/media_repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ async def _upload_to_url(
304304
)
305305
upload_response.raise_for_status()
306306
except Exception as e:
307-
if retry_count == 0:
307+
if retry_count <= 0:
308308
raise make_request_error(
309309
http_status=upload_response.status if upload_response else -1,
310310
text=(await upload_response.text()) if upload_response else "",
@@ -317,7 +317,7 @@ async def _upload_to_url(
317317
)
318318
await asyncio.sleep(backoff)
319319
backoff *= 2
320-
retry_count = -1
320+
retry_count -= 1
321321
else:
322322
break
323323

0 commit comments

Comments
 (0)