Skip to content
Snippets Groups Projects
Commit 2548f01f authored by Tim Kreuzer's avatar Tim Kreuzer
Browse files

fix logging in cleanup

parent 9b74a799
No related branches found
No related tags found
No related merge requests found
Pipeline #185700 passed
...@@ -48,9 +48,6 @@ async def check_running_services(): ...@@ -48,9 +48,6 @@ async def check_running_services():
i = 0 i = 0
for jhub_cleanup_name in jhub_cleanup_names: for jhub_cleanup_name in jhub_cleanup_names:
# call request, check if it's running # call request, check if it's running
log.debug(
f"PeriodicCheck - Call list servers {jhub_cleanup_name} - {running_services_in_jhub[jhub_cleanup_name]}"
)
try: try:
r = requests.get( r = requests.get(
jhub_cleanup_urls_list[i], jhub_cleanup_urls_list[i],
...@@ -64,13 +61,16 @@ async def check_running_services(): ...@@ -64,13 +61,16 @@ async def check_running_services():
running_services_in_jhub[jhub_cleanup_name] = r.json() running_services_in_jhub[jhub_cleanup_name] = r.json()
except: except:
log.exception( log.exception(
"PeriodicCheck - Could not check running services" f"PeriodicCheck - Could not check running services for {jhub_cleanup_name}"
) )
finally: finally:
i += 1 i += 1
all_services = get_services_all(db=db) all_services = get_services_all(db=db)
for service in all_services: for service in all_services:
if service["jupyterhub"] in running_services_in_jhub.keys(): if service["jupyterhub"] in running_services_in_jhub.keys():
log.debug(
f"PeriodicCheck - Servers at {service['jupyterhub']} - {running_services_in_jhub[service['jupyterhub']]}"
)
# Only check services which are running at least 30 minutes # Only check services which are running at least 30 minutes
if ( if (
f"{service['jupyterhub_userid']}_{service['name']}_{service['start_id']}" f"{service['jupyterhub_userid']}_{service['name']}_{service['start_id']}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment