diff --git a/lib/Livecam/Main.pm b/lib/Livecam/Main.pm index bd8e6b0..556fcb3 100644 --- a/lib/Livecam/Main.pm +++ b/lib/Livecam/Main.pm @@ -113,6 +113,7 @@ sub livecam { $self->app->ua->get($url->to_abs); # setup cookies $url->path('/camws/cam-image.php'); + # handler my $send_image = sub { my $seed = sprintf "%.15f", rand(1); $url->query(cam => $cam->{id}, r => $seed); @@ -135,6 +136,7 @@ sub livecam { $send_image->(); # initial send Mojo::IOLoop->stream($self->tx->connection)->timeout(30); + # log events inside timer's handler to main app log Mojo::IOLoop->singleton->reactor->on(error => sub { my ($reactor, $err) = @_; $self->app->log->error($err);