Adding lock to recurring.
This commit is contained in:
parent
e885958ea0
commit
8426dc6dfb
|
@ -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;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue