Unverified Commit 3be71be2 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

InTransit#get_all_active: sort by earlier arrival first

This favours trips that will soon end in case a backend is limiting es beyond
our capacity to wait, thus hopefully slightly improving the practical use of
the limited amount of real-time data that we can still get
parent c476466a
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -711,8 +711,14 @@ sub get_timeline {
sub get_all_active {
	my ( $self, %opt ) = @_;
	my $db = $opt{db} // $self->{pg}->db;
	return $db->select( 'in_transit_str', '*', { cancelled => 0 } )
	  ->hashes->each;

	my @res = $db->select(
		'in_transit_str', '*',
		{ cancelled => 0 },
		{ -asc      => 'real_arr_ts' }
	)->hashes->each;

	return @res;
}

sub get_checkout_ids {