Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed timed batching with Supply.batch
  • Loading branch information
lizmat committed Apr 21, 2014
1 parent 0fb001e commit 98c2b3d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/core/SupplyOperations.pm
Expand Up @@ -315,24 +315,24 @@ my class SupplyOperations is repr('Uninstantiable') {

$!elems # and $!seconds
?? -> \val {
@batched.push: val;
if @batched.elems == $!elems {
flush;
my $this_time = time div $!seconds;
if $this_time != $last_time {
flush if @batched;
$last_time = $this_time;
@batched.push: val;
}
else {
my $this_time = time div $!seconds;
if $this_time != $last_time {
flush;
$last_time = $this_time;
}
@batched.push: val;
flush if @batched.elems == $!elems;
}
}
!! -> \val {
my $this_time = time div $!seconds;
if $this_time != $last_time {
flush;
flush if @batched;
$last_time = $this_time;
}
@batched.push: val;
}
}
else { # just $!elems
Expand Down

0 comments on commit 98c2b3d

Please sign in to comment.