diff --git a/lib/TgMagicPdf/Telegram.pm b/lib/TgMagicPdf/Telegram.pm index 1f04c7d..5f00f9f 100644 --- a/lib/TgMagicPdf/Telegram.pm +++ b/lib/TgMagicPdf/Telegram.pm @@ -39,9 +39,14 @@ sub run ($self) { } sub _dispatch_updates ($self) { + my $in_process = 0; Mojo::IOLoop->recurring( - 0.5, + 0.1, sub { + if ($in_process) { + return; + } + $in_process = 1; if ( $self->_used_cores >= $self->_cores ) { return; } @@ -96,6 +101,7 @@ sub _dispatch_updates ($self) { ); say $i; } + $in_process = 0; } ); }