Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

fix: remove unused protocol detection logic in populate.py #45

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: remove unused protocol detection logic in populate.py
stefanwagnerdev committed Jan 30, 2025
commit f597bfba59a982a9308620eb5f56b9716cbf1ac2
28 changes: 1 addition & 27 deletions nova_rerun_bridge/polling/populate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio

import aiohttp
import rerun as rr
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from apscheduler.triggers.interval import IntervalTrigger
@@ -16,27 +15,6 @@
previous_motion_group_list = []


async def get_protocol(host) -> str:
api = "/api/v1/cells/cell/controllers"

async with aiohttp.ClientSession() as session:
try:
async with session.get(f"https://{host}{api}", timeout=5) as response:
if response.status == 200:
return "https://"
except aiohttp.ClientError:
pass

try:
async with session.get(f"http://{host}{api}", timeout=5) as response:
if response.status == 200:
return "http://"
except aiohttp.ClientError:
pass

return None


async def process_motions():
"""
Fetch and process all unprocessed motions.
@@ -45,11 +23,7 @@ async def process_motions():
global first_run
global previous_motion_group_list

protocol = await get_protocol("api-gateway.wandelbots.svc.cluster.local:8080")

async with Nova(
host=f"{protocol}api-gateway.wandelbots.svc.cluster.local:8080", verify_ssl=False
) as nova:
async with Nova(host="http://api-gateway:8080", verify_ssl=False) as nova:
motion_api = nova._api_client.motion_api
motion_group_api = nova._api_client.motion_group_api