DBDB: use realtime cache for carriage composition requests
This commit is contained in:
parent
2576a463db
commit
9442572084
2 changed files with 9 additions and 8 deletions
|
@ -362,11 +362,12 @@ sub startup {
|
|||
dbdb => sub {
|
||||
my ($self) = @_;
|
||||
state $dbdb = Travelynx::Helper::DBDB->new(
|
||||
log => $self->app->log,
|
||||
cache => $self->app->cache_iris_main,
|
||||
root_url => $self->base_url_for('/')->to_abs,
|
||||
user_agent => $self->ua,
|
||||
version => $self->app->config->{version},
|
||||
log => $self->app->log,
|
||||
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},
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -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) ) {
|
||||
|
|
Loading…
Reference in a new issue