Skip to content

Commit

Permalink
give uptimetimer timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Chlorophytus committed Aug 31, 2024
1 parent 7a8d935 commit 3514330
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.25)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Project instantiation
project(chlorobot VERSION 1.3.1.52)
project(chlorobot VERSION 1.3.2.52)

# Fetch gRPC
option(USE_SYSTEM_GRPC "Use system installed gRPC" ON)
Expand Down
2 changes: 1 addition & 1 deletion chloresolve/chloresolve/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.1+rev56"
__version__ = "1.3.2+rev57"
1 change: 0 additions & 1 deletion chloresolve/chloresolve/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def __init__(self, cloak: str):
if raw_perms is None:
self.visitor = PermissionsVisitor(clower, [])
else:
self.logger.info(raw_perms)
(perms,) = raw_perms
self.visitor = PermissionsVisitor(clower, perms.split(","))

Expand Down
10 changes: 8 additions & 2 deletions chloresolve/chloresolve/uptime_pinging.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ async def heartbeat(self):
"""
Heartbeats to an UptimeRobot/etc. URL
"""
requests.get(self.uri)
self.logger.info("Sending heartbeat")
for i in range(3):
try:
self.logger.info(f"Sending heartbeat try {i + 1}")
requests.get(self.uri, timeout=5)
break
except requests.exceptions.Timeout:
self.logger.info(f"Heartbeat try {i + 1} timed out")
self.logger.info("Done trying heartbeat")
await asyncio.sleep(self.interval_seconds)
await self.heartbeat()

Expand Down

0 comments on commit 3514330

Please sign in to comment.