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) = @_;
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue