Skip to content

Commit

Permalink
fix: do done before wait
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Dec 8, 2023
1 parent 6834d31 commit c1ee5b7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (a *FlowableActivity) StartFlow(ctx context.Context,
log.Warnf("failed to push records: %v", err)
return nil, fmt.Errorf("failed to push records: %w", err)
}

done <- struct{}{}
err = errGroup.Wait()
if err != nil {
return nil, fmt.Errorf("failed to pull records: %w", err)
Expand Down Expand Up @@ -386,7 +386,6 @@ func (a *FlowableActivity) StartFlow(ctx context.Context,

pushedRecordsWithCount := fmt.Sprintf("pushed %d records", numRecords)
activity.RecordHeartbeat(ctx, pushedRecordsWithCount)
done <- struct{}{}

return res, nil
}
Expand Down

0 comments on commit c1ee5b7

Please sign in to comment.