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

carriage formation: show timestamp of (possibly cached) result

parent 13502189
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ sub wagenreihung {
				wref        => $wref,
				exit_dir    => $exit_dir,
				hide_opts   => 1,
				ts          => $json->{ts},
			);
		}
	)->catch(
+3 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use strict;
use warnings;
use 5.020;

use DateTime;
use Mojo::Promise;

sub new {
@@ -93,6 +94,8 @@ sub get_p {

			$self->{log}->debug("wagonorder->get_p($url): OK");
			my $json = $tx->res->json;
			$json->{ts} = DateTime->now( time_zone => 'Europe/Berlin' )
			  ->strftime('%d.%m.%Y %H:%M');

			$self->{main_cache}->freeze( $url, $json );
			$promise->resolve( $json, \%param );
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
    </div>
-->
    <p class="copyright">
      Quelle: DB Wagenreihungs-API. Angaben ohne Gewähr.
      Quelle: DB Wagenreihungs-API (<%= stash('ts') // q{} %>). Angaben ohne Gewähr.
    </p>

  </div>