route: only override delay if real-time data is not available
This commit is contained in:
parent
d18d068894
commit
af3cdee113
1 changed files with 7 additions and 2 deletions
|
@ -1023,8 +1023,13 @@ sub startup {
|
||||||
$old{$k} = $station->[2]{$k};
|
$old{$k} = $station->[2]{$k};
|
||||||
}
|
}
|
||||||
$station->[2] = $sd;
|
$station->[2] = $sd;
|
||||||
for my $k (qw(rt_arr rt_dep arr_delay dep_delay)) {
|
if ( not $station->[2]{rt_arr} ) {
|
||||||
$station->[2]{$k} ||= $old{$k};
|
$station->[2]{rt_arr} = $old{rt_arr};
|
||||||
|
$station->[2]{arr_delay} = $old{arr_delay};
|
||||||
|
}
|
||||||
|
if ( not $station->[2]{rt_dep} ) {
|
||||||
|
$station->[2]{rt_dep} = $old{rt_dep};
|
||||||
|
$station->[2]{dep_delay} = $old{dep_delay};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue