From 0011e4a18d95e2ddd1e6561aec9fb63d71ed5bba Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 20 Feb 2020 20:58:58 +0100 Subject: user_status: Improve TS lookup performance --- lib/Travelynx/Controller/Traveling.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib/Travelynx') diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 1d8a644..dca53db 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -60,15 +60,18 @@ sub user_status { { for my $candidate ( $self->get_user_travels( - uid => $user->{id}, - limit => 10, - verbose => 1, - with_datetime => 1 + uid => $user->{id}, + limit => 10, ) ) { - if ( $candidate->{sched_departure}->epoch eq $ts ) { - $journey = $candidate; + if ( $candidate->{sched_dep_ts} eq $ts ) { + $journey = $self->get_journey( + uid => $user->{id}, + journey_id => $candidate->{id}, + verbose => 1, + with_datetime => 1, + ); } } } -- cgit v1.2.3