diff options
author | Daniel Friesel <derf@finalrewind.org> | 2020-02-20 20:58:58 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2020-02-20 20:58:58 +0100 |
commit | 0011e4a18d95e2ddd1e6561aec9fb63d71ed5bba (patch) | |
tree | 8795689faeb94fce0bb8be20899deec5f6324f9c /lib/Travelynx/Controller/Traveling.pm | |
parent | 57f686b688d1ae09a3ab6fe6b54ba3c7c18c16a6 (diff) |
user_status: Improve TS lookup performance
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
-rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 15 |
1 files changed, 9 insertions, 6 deletions
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, + ); } } } |