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

DBDB: use realtime cache for carriage composition requests

parent 2576a463
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -363,7 +363,8 @@ sub startup {
			my ($self) = @_;
			state $dbdb = Travelynx::Helper::DBDB->new(
				log            => $self->app->log,
				cache      => $self->app->cache_iris_main,
				main_cache     => $self->app->cache_iris_main,
				realtime_cache => $self->app->cache_iris_rt,
				root_url       => $self->base_url_for('/')->to_abs,
				user_agent     => $self->ua,
				version        => $self->app->config->{version},
+3 −3
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ sub has_wagonorder_p {
	my $api_ts = $ts->strftime('%Y%m%d%H%M');
	my $url
	  = "https://ist-wr.noncd.db.de/wagenreihung/1.0/${train_no}/${api_ts}";
	my $cache   = $self->{cache};
	my $cache   = $self->{realtime_cache};
	my $promise = Mojo::Promise->new;

	if ( my $content = $cache->get("HEAD $url") ) {
@@ -73,7 +73,7 @@ sub get_wagonorder_p {
	my $url
	  = "https://ist-wr.noncd.db.de/wagenreihung/1.0/${train_no}/${api_ts}";

	my $cache   = $self->{cache};
	my $cache   = $self->{realtime_cache};
	my $promise = Mojo::Promise->new;

	if ( my $content = $cache->thaw($url) ) {
@@ -113,7 +113,7 @@ sub get_stationinfo_p {

	my $url = "https://lib.finalrewind.org/dbdb/s/${eva}.json";

	my $cache   = $self->{cache};
	my $cache   = $self->{main_cache};
	my $promise = Mojo::Promise->new;

	if ( my $content = $cache->thaw($url) ) {