From 25c2cbcd833a4fe9e210efede1c82ad28b54163e Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Mon, 15 Dec 2014 13:05:38 +1000 Subject: [PATCH] =?UTF-8?q?*=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Livecam/Main.pm | 2 ++ 1 file changed, 2 insertions(+) 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);