Hi All,

I am on Mojolicious 8.13 and running simple logic to connect to a https 
site periodically.

The code is really simple and typical:

my $make_connection = sub {
    my $promise = Mojo::Promise->new;
    my $call_start = AnyEvent->now;
    $ua->get( $api_base . '/'
        => sub {
            my ($ua, $tx) = @_;
            $delay{http_connection} = AnyEvent->now - $call_start;
            my $res = $tx->result;
            if ($res->is_success) {
                AE::log debug => 'http connection ok';
                AE::log info => "http_connection delay=%f", $delay{
http_connection};
                $promise->resolve();
            }
            else {
                my $err = $tx->error;
                $promise->reject('http_connection failed: http request 
error, code='.$err->{code}.' message='.$err->{message});
            }
        }
    );
    return $promise;
};



After running for a random length of time, it gives *Mojo::Reactor::EV: 
Timer failed*  at  the "my $res = $tx->result" line and lockup. I am not 
able to catch the error using:

$ua->on(error => sub {
  my ($ua, $err) = @_;
  AE::log critical => "main agent error: $err";
});


$EV::DIED = sub {
 AE::log fatal => "EV fatal error:" . $@;
 kill("TERM", $$);
 exit 1;
};



Any ideas please?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to