Skip to content

Create send_location_helper.py#36

Open
BuTian5 wants to merge 1 commit intomainfrom
BuTian5-patch-send-location
Open

Create send_location_helper.py#36
BuTian5 wants to merge 1 commit intomainfrom
BuTian5-patch-send-location

Conversation

@BuTian5
Copy link

@BuTian5 BuTian5 commented Nov 17, 2024

No description provided.

import requests
import os

BASESTATION_URL = os.getenv("BASESTATION_URL", "https://basestation.example.com")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not work, as the basestation url is not known and should be derived from the routing.

BASESTATION_URL = os.getenv("BASESTATION_URL", "https://basestation.example.com")

def send_location(location_data):
"""Send the satellite's location to the basestation."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the routing logic, find what is the next node to send your request to.

"function": location_data.get("function")
}
try:
response = requests.post(url, json=payload, timeout=5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line 9-14 and pass json=location_data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants