get_stationinfo_p: cache negative replies
This commit is contained in:
parent
2316e03da9
commit
2788f97f32
1 changed files with 2 additions and 0 deletions
|
@ -116,6 +116,7 @@ sub get_stationinfo_p {
|
||||||
my ($tx) = @_;
|
my ($tx) = @_;
|
||||||
|
|
||||||
if ( my $err = $tx->error ) {
|
if ( my $err = $tx->error ) {
|
||||||
|
$cache->freeze( $url, {} );
|
||||||
$promise->reject("HTTP $err->{code} $err->{message}");
|
$promise->reject("HTTP $err->{code} $err->{message}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -128,6 +129,7 @@ sub get_stationinfo_p {
|
||||||
)->catch(
|
)->catch(
|
||||||
sub {
|
sub {
|
||||||
my ($err) = @_;
|
my ($err) = @_;
|
||||||
|
$cache->freeze( $url, {} );
|
||||||
$promise->reject($err);
|
$promise->reject($err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue