Skip to content

Commit

Permalink
Sleep when no input is available while streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmalkmus committed Aug 19, 2024
1 parent c471443 commit c4e9464
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/cmd/ingest/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ func ingestEvery(ctx context.Context, client *axiom.Client, r io.Reader, opts *o
_ = pw.CloseWithError(ctx.Err())
return
default:
time.Sleep(time.Millisecond)
}

if !scanner.Scan() {
Expand Down Expand Up @@ -415,6 +416,8 @@ func ingestEvery(ctx context.Context, client *axiom.Client, r io.Reader, opts *o
case <-done:
_ = pw.Close()
return
default:
time.Sleep(time.Millisecond)
}
}
}()
Expand Down

0 comments on commit c4e9464

Please sign in to comment.