Log if ther is a problem loading positions.

This commit is contained in:
Rasmus Kaj 2018-02-11 18:10:00 +01:00
parent b567e6625f
commit 0357667858

View File

@ -47,7 +47,8 @@ pub fn get_positions(photos: &[Photo], c: &PgConnection) -> Vec<Coord> {
.filter(photo_id.eq_any(photos.iter().map(|p| p.id)))
.select((latitude, longitude))
.load(c)
.unwrap_or_default() // TODO Log if there is a problem?
.map_err(|e| warn!("Failed to load positions: {}", e))
.unwrap_or_default()
.into_iter()
.map(|(lat, long): (i32, i32)| Coord {
x: f64::from(lat) / 1e6,