Skip to content

Commit c4e9464

Browse files
committed
Sleep when no input is available while streaming
1 parent c471443 commit c4e9464

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/cmd/ingest/ingest.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ func ingestEvery(ctx context.Context, client *axiom.Client, r io.Reader, opts *o
382382
_ = pw.CloseWithError(ctx.Err())
383383
return
384384
default:
385+
time.Sleep(time.Millisecond)
385386
}
386387

387388
if !scanner.Scan() {
@@ -415,6 +416,8 @@ func ingestEvery(ctx context.Context, client *axiom.Client, r io.Reader, opts *o
415416
case <-done:
416417
_ = pw.Close()
417418
return
419+
default:
420+
time.Sleep(time.Millisecond)
418421
}
419422
}
420423
}()

0 commit comments

Comments
 (0)