changeset 2279:9e7500543ab6

take out retries
author drewp@bigasterisk.com
date Mon, 29 May 2023 19:33:16 -0700
parents 702c1fd95dfd
children e462853f1ef6
files light9/collector/collector_client_asyncio.py
diffstat 1 files changed, 0 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/light9/collector/collector_client_asyncio.py	Mon May 29 15:18:32 2023 -0700
+++ b/light9/collector/collector_client_asyncio.py	Mon May 29 19:33:16 2023 -0700
@@ -1,5 +1,4 @@
 import logging
-import tenacity
 from light9 import networking
 from light9.collector.collector_client import toCollectorJson
 from light9.effect.settings import DeviceSettings
@@ -20,13 +19,7 @@
     async def send(self, client: str, session: str, settings: DeviceSettings):
         msg = toCollectorJson(client, session, settings).encode('utf8')
 
-        @tenacity.retry(
-            retry=tenacity.retry_if_exception_type(aiohttp.ServerTimeoutError),
-            reraise=True, 
-            stop=tenacity.stop_after_attempt(3),
-            )
         async def put():
-
             async with self.http_session.put(networking.collector.path('attrs'), data=msg, timeout=.2) as resp:
                 if resp.status != 202:
                     body = await resp.text()
@@ -34,9 +27,6 @@
                     raise ValueError(f'collector returned {resp.status}: {body}')
 
         await put()
-        attempts = put.retry.statistics['attempt_number']
-        if attempts!=1:
-            log.warning(f"{attempts=}")
 
 
 _sender = _Sender()