Skip to content

Commit

Permalink
Merge pull request #74 from CanDIG/develop
Browse files Browse the repository at this point in the history
hotfix
  • Loading branch information
daisieh authored Oct 18, 2024
2 parents 50d3c58 + 8e502de commit 6da555c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions candig_federation/heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ def check_pulse():
# Determine which sites we have access to
live_servers = []
log = ""
try:
for server in servers.values():
for server in servers.values():
try:
url = f"{server['server']['url']}/hello"
log += f"\ntesting {url}"
service_info = requests.get(url, timeout=2)
if service_info.ok:
live_servers.append(server['server']['id'])
except Exception as e:
log += "\n" + str(e)

# Determine whether or not those sites are available by pinging Federation service-info
with open('/app/federation/live_servers.txt', 'w') as f:
f.write("|".join(live_servers))
except Exception as e:
log += "\n" + str(e)
# Determine whether or not those sites are available by pinging Federation service-info
with open('/app/federation/live_servers.txt', 'w') as f:
f.write("|".join(live_servers))

with open('/app/federation/log.txt', 'w') as f:
f.write(log)
f.write(str(e))
with open('/app/federation/log.txt', 'w') as f:
f.write(log)
f.write(str(e))


def get_live_servers():
Expand Down

0 comments on commit 6da555c

Please sign in to comment.