From 1a080286b3b30e24639917c3aaaab1aafa5db005 Mon Sep 17 00:00:00 2001 From: MrMurdog Date: Mon, 15 Jan 2024 10:09:43 +0100 Subject: [PATCH] =?UTF-8?q?=C3=A4nderung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/bosmon_aiohttp.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/plugin/bosmon_aiohttp.py b/plugin/bosmon_aiohttp.py index 97ad2a4..503dfe6 100644 --- a/plugin/bosmon_aiohttp.py +++ b/plugin/bosmon_aiohttp.py @@ -99,19 +99,12 @@ class BoswatchPlugin(PluginBase): async with aiohttp.ClientSession() as session: async with session.post(url, data=payload, headers=headers) as response: response_text = await response.text() - - asyncio.ensure_future(self._fetch(url, session)) - + logging.exception(response_text) - await response_text - - async def _fetch(self, url, session): - """Fetches requests - - @param url: url - - @param session: Clientsession instance""" - async with session.get(url) as response: - logging.info("{} returned [{}]".format(response.url, response.status)) - return await response.read() \ No newline at end of file + def teardown(self): + r"""!Called after alarm + Remove if not implemented""" + + loop = asyncio.get_event_loop() + loop.run_until_complete(_post_Request()) \ No newline at end of file