From 8a1d12eea0663cdd4cd136fa6f2446e4fe0aad04 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 2 Jun 2020 19:53:17 +0200 Subject: Work around DB IRIS coupling Norddeich and Norddeich Mole see https://github.com/marudor/BahnhofsAbfahrten/issues/352 --- lib/Travel/Status/DE/IRIS.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm index ec35cac..1706d67 100644 --- a/lib/Travel/Status/DE/IRIS.pm +++ b/lib/Travel/Status/DE/IRIS.pm @@ -212,7 +212,13 @@ sub get_station { my $iter_depth = 0; my @ret; my @queue = ( $opt{name} ); - my @seen; + + # @seen holds station IDs which were already seen during recursive + # 'meta' descent. This avoids infinite loops of 'meta' references. + # As Norddeich and Norddeich Mole are illegaly coupled in the backend + # (they are different stations with different departure times), we pre-seed + # @seen with their eva IDs. + my @seen = ( 8007768, 8004449 ); while ( @queue and $iter_depth < 12 ) { my $station = shift(@queue); -- cgit v1.2.3