[P] Sync the async function

This commit is contained in:
2026-03-27 18:15:34 +02:00
parent adae93aba4
commit 0182d20348

View File

@@ -4,7 +4,6 @@ from datetime import datetime
import websockets
from kivy import Logger
from pydantic import BaseModel, field_validator
from websockets.asyncio.connection import Connection
from config import STORE_HOST, STORE_PORT
@@ -65,10 +64,10 @@ class Datasource:
self.connection_status = "Disconnected"
Logger.debug("SERVER DISCONNECT")
async def update_db_records(self):
def update_db_records(self):
if self.websocket:
data = json.dumps({"id": self.user_id})
await self.websocket.send(data, True)
asyncio.ensure_future(self.websocket.send(data))
def map_lat_lon_to_processed_agent_data(self, lat: float, lon: float) -> ProcessedAgentData | None:
distances = tuple((abs(lon - marker.latitude) ** 2 + abs(lat - marker.longitude) ** 2) ** 0.5 for marker in