Sada bugfixu

This commit is contained in:
Michal Kváček
2024-08-12 06:27:28 +02:00
parent 9e6b0b574c
commit 94639da820
6 changed files with 174 additions and 190 deletions
+4 -8
View File
@@ -1,4 +1,3 @@
from aiohttp import ClientResponseError
from sqlalchemy import select
from database import models
from database.transaction import get_session
@@ -16,18 +15,15 @@ async def add_terrain_elevation_to_flight(flight_id: int):
.join(models.Track.flight)
.filter(models.Flight.id == flight_id))
).all()
try:
await update_track_points_elevation(db, track_points)
except ClientResponseError as e:
print(e)
await update_track_points_elevation(db, track_points)
@retryable
async def add_terrain_elevation_to_photo(photo):
try:
elevation = await elevation_api.get_elevation_for_points([
{"lat": photo.gps_latitude, "lng": photo.gps_longitude}
])
elevation = await elevation_api.get_elevation_for_points(
[{"lat": photo.gps_latitude, "lng": photo.gps_longitude}]
)
if not elevation:
print("Cannot get elevation")
return