Skip to content

Commit

Permalink
Merge pull request #43 from BloodHoundAD/BED-3349
Browse files Browse the repository at this point in the history
Increase ingest timeout duration and decrease maximum number of objects transmitted per ingest call
  • Loading branch information
elikmiller authored Jun 5, 2023
2 parents 18e629e + 971f9ec commit 74ccf0f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func start(ctx context.Context) {

// Batch data out for ingestion
stream := listAll(ctx, azClient)
batches := pipeline.Batch(ctx.Done(), stream, 999, 10*time.Second)
batches := pipeline.Batch(ctx.Done(), stream, 256, 10*time.Second)
hasIngestErr := ingest(ctx, *bheInstance, bheClient, batches)

// Notify BHE instance of task end
Expand Down Expand Up @@ -187,7 +187,10 @@ func ingest(ctx context.Context, bheUrl url.URL, bheClient *http.Client, in <-ch
Data: data,
}

if req, err := rest.NewRequest(ctx, "POST", endpoint, body, nil, nil); err != nil {
headers := make(map[string]string)
headers["Prefer"] = "wait=60"

if req, err := rest.NewRequest(ctx, "POST", endpoint, body, nil, headers); err != nil {
log.Error(err, "unable to create ingest HTTP request")
hasErrors = true
} else {
Expand Down

0 comments on commit 74ccf0f

Please sign in to comment.