Skip to content

Commit

Permalink
properly add the task
Browse files Browse the repository at this point in the history
  • Loading branch information
Chlorophytus committed Oct 2, 2024
1 parent 151d454 commit 2257490
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chloresolve/chloresolve/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.1+rev72"
__version__ = "1.4.1+rev73"
3 changes: 1 addition & 2 deletions chloresolve/chloresolve/uptime_pinging.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def __init__(self, interval_seconds: int, uri: str):
self.interval_seconds = interval_seconds
self.uri = uri
self.loop = asyncio.get_event_loop()
self.task = self.loop.create_task(self.heartbeat())
self.logger = logging.getLogger(__class__.__name__)

async def heartbeat(self):
Expand Down Expand Up @@ -53,7 +52,7 @@ async def start(self):
"""
try:
self.logger.info("Heartbeat task starting")
self.loop.run_until_complete(self.task)
self.task = self.loop.create_task(self.heartbeat())
except Exception as exc:
self.logger.info("Heartbeat task failed or cancelled")
self.logger.info(
Expand Down

0 comments on commit 2257490

Please # to comment.