get_stationinfo_p: cache negative replies

This commit is contained in:
Daniel Friesel 2020-09-20 09:55:28 +02:00
parent 2316e03da9
commit 2788f97f32

View file

@ -116,6 +116,7 @@ sub get_stationinfo_p {
my ($tx) = @_;
if ( my $err = $tx->error ) {
$cache->freeze( $url, {} );
$promise->reject("HTTP $err->{code} $err->{message}");
return;
}
@ -128,6 +129,7 @@ sub get_stationinfo_p {
)->catch(
sub {
my ($err) = @_;
$cache->freeze( $url, {} );
$promise->reject($err);
return;
}