Commit b54c977e authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

increase checkout delay to work around IRIS information lag

parent 962aac63
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -29,8 +29,14 @@ sub run {

		$self->app->log->debug("Processing $uid");

		# Note: IRIS data is not always updated in real-time. Both departure and
		# arrival delays may take several minutes to appear, especially in case
		# of large-scale disturbances. We work around this by continuing to
		# update departure data for up to 15 minutes after departure and
		# delaying automatic checkout by at least 10 minutes.

		eval {
			if ( $now->epoch - $entry->{real_dep_ts} < 300 ) {
			if ( $now->epoch - $entry->{real_dep_ts} < 900 ) {
				$self->app->log->debug("  - updating departure");
				my $status = $self->app->get_departures( $dep, 30, 30 );
				if ( $status->{errstr} ) {
@@ -71,7 +77,7 @@ sub run {
			if (
				$entry->{arr_name}
				and ( not $entry->{real_arr_ts}
					or $now->epoch - $entry->{real_arr_ts} < 60 )
					or $now->epoch - $entry->{real_arr_ts} < 600 )
			  )
			{
				$self->app->log->debug("  - updating arrival");
+3 −3
Original line number Diff line number Diff line
@@ -144,9 +144,9 @@
		% }
		% if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) {
			<p style="margin-top: 2ex;">
				Der automatische Checkout erfolgt in wenigen Minuten. Zum Umsteigen:
				Aktuelle Station erneut in der Liste auswählen. Zum Weiterfahren im
				aktuellen Zug: Neues Ziel wählen.
				Der automatische Checkout erfolgt erst zehn Minuten nach der
				Ankunft, um verzögerte IRIS-Updates zu berücksichtigen. Du kannst
				bereits jetzt in einen neuen Zug einchecken.
			</p>
		% }
		% elsif ($journey->{arr_name}) {