From 38db4544b5024f2bae271eb0a29bea15b316c5e7 Mon Sep 17 00:00:00 2001 From: Wolf Lindstrot Date: Mon, 16 Jun 2025 13:21:06 +0200 Subject: [PATCH] fix: Matrix plugin confuses ms and s in log message --- apprise/plugins/matrix.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/apprise/plugins/matrix.py b/apprise/plugins/matrix.py index c0ec83b5..41f8b046 100644 --- a/apprise/plugins/matrix.py +++ b/apprise/plugins/matrix.py @@ -177,7 +177,7 @@ class NotifyMatrix(NotifyBase): default_retries = 2 # The number of micro seconds to wait if we get a 429 error code and - # the server doesn't remind us how long we shoul wait for + # the server doesn't remind us how long we should wait for default_wait_ms = 1000 # Our default is to no not use persistent storage beyond in-memory @@ -1319,25 +1319,24 @@ class NotifyMatrix(NotifyBase): response = loads(r.content) if r.status_code == requests.codes.too_many_requests: - wait = self.default_wait_ms / 1000 + wait_ms = self.default_wait_ms try: - wait = response['retry_after_ms'] / 1000 + wait_ms = response['retry_after_ms'] except KeyError: try: errordata = response['error'] - wait = errordata['retry_after_ms'] / 1000 + wait_ms = errordata['retry_after_ms'] except KeyError: pass self.logger.warning( - 'Matrix server requested we throttle back {}ms; ' - 'retries left {}.'.format(wait, retries)) - self.logger.debug( - 'Response Details:\r\n{}'.format(r.content)) + f'Matrix server requested we throttle back ' + f'{wait_ms}ms; retries left {retries}.') + self.logger.debug(f'Response Details:\r\n{r.content}') # Throttle for specified wait - self.throttle(wait=wait) + self.throttle(wait=wait_ms / 1000) # Try again continue