def get_celery_health_check_command(node_type: str):
    """
    Constructs a health check command for celery workers.
    :param node_type: A string with the name of the node type to add to hostnames.
    """
    hostnames = ["priority@$HOSTNAME"]
    if node_type != "priority":
        hostnames.append(f"{node_type}@$HOSTNAME")

    ping_command = " && ".join(
        [f"celery inspect -A eventkit_cloud --timeout=20 --destination={hostname} ping" for hostname in hostnames]
    )
    health_check_command = (
        f" & sleep 30; while {ping_command} >/dev/null 2>&1; do sleep 60; done; "
        "echo At least one $HOSTNAME worker is dead! Killing Task...; pkill celery"
    )

    return health_check_command