summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/IRIS.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-06-02 19:53:17 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-06-02 19:53:17 +0200
commit8a1d12eea0663cdd4cd136fa6f2446e4fe0aad04 (patch)
treecc2fd7b582e9cfab864f7207283c887fd54b0a86 /lib/Travel/Status/DE/IRIS.pm
parentbdf4fb69313ff849a23b782a1809c79c7e4b8ceb (diff)
Work around DB IRIS coupling Norddeich and Norddeich Mole
see https://github.com/marudor/BahnhofsAbfahrten/issues/352
Diffstat (limited to 'lib/Travel/Status/DE/IRIS.pm')
-rw-r--r--lib/Travel/Status/DE/IRIS.pm8
1 files changed, 7 insertions, 1 deletions
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);