Skip to content

Commit 232c298

Browse files
committed
don't buff first 10 seconds
1 parent 0b598a0 commit 232c298

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/sparky-web.raku

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ sub create-cro-app ($pool) {
4242
whenever $incoming -> $message {
4343
my $done = False;
4444
my @chunk;
45+
my $i = 0;
4546
while True {
4647
my @data = "$reports-dir/$project/build-$build_id.txt".IO.lines;
4748
for @data[$last_e .. *] -> $l {
@@ -52,7 +53,8 @@ sub create-cro-app ($pool) {
5253
@chunk.push($msg);
5354
#emit($msg);
5455
}
55-
if @chunk.elems >= 1000 {
56+
$i++; sleep(1);
57+
if @chunk.elems and (@chunk.elems >= 1000 or $i <= 10) {
5658
say("ws: send data to client: {@chunk.elems} lines");
5759
emit(@chunk.join("\n"));
5860
@chunk = ();

0 commit comments

Comments
 (0)