diff --git a/candig_federation/heartbeat.py b/candig_federation/heartbeat.py index 6130981..9e8971d 100644 --- a/candig_federation/heartbeat.py +++ b/candig_federation/heartbeat.py @@ -7,6 +7,8 @@ def check_pulse(): servers = get_registered_servers() + if servers is None: + return if len(servers) == 0: return # Determine which sites we have access to diff --git a/candig_federation/operations.py b/candig_federation/operations.py index e9d9490..2996102 100644 --- a/candig_federation/operations.py +++ b/candig_federation/operations.py @@ -115,7 +115,11 @@ def list_services(): """ :return: Dictionary of registered services. """ - return list(get_registered_services().values()), 200 + services = get_registered_services() + if services is not None: + return list(services.values()), 200 + logger.debug(f"Couldn't list services", request) + return {"message": "Couldn't list services"}, 500 @app.route('/services/')