(component)
Reload a TLJH component.

    component can be 'hub' or 'proxy'.
Reload a TLJH component.
Reload a TLJH component .
def reload_component(component):
    """
    Reload a TLJH component.

    component can be 'hub' or 'proxy'.
    """
    # import here to avoid circular imports
    from tljh import systemd, traefik

    if component == "hub":
        systemd.restart_service("jupyterhub")
        # Ensure hub is back up
        while not systemd.check_service_active("jupyterhub"):
            time.sleep(1)
        while not check_hub_ready():
            time.sleep(1)
        print("Hub reload with new configuration complete")
    elif component == "proxy":
        traefik.ensure_traefik_config(STATE_DIR)
        systemd.restart_service("traefik")
        while not systemd.check_service_active("traefik"):
            time.sleep(1)
        print("Proxy reload with new configuration complete")
def reload_component ( component ) : # import here to avoid circular imports from tljh import systemd , traefik if component == "hub" : systemd . restart_service ( "jupyterhub" ) # Ensure hub is back up while not systemd . check_service_active ( "jupyterhub" ) : time . sleep ( 1 ) while not check_hub_ready ( ) : time . sleep ( 1 ) print ( "Hub reload with new configuration complete" ) elif component == "proxy" : traefik . ensure_traefik_config ( STATE_DIR ) systemd . restart_service ( "traefik" ) while not systemd . check_service_active ( "traefik" ) : time . sleep ( 1 ) print ( "Proxy reload with new configuration complete" )