145
ctx context.Context,
146
firstEventID int64,
148
>
size := 0
149
>
targetSize := i.targetHistoryBlobSize
150
>
var historyBatches []*historypb.History
151
>
newIterState := historyIteratorState{}
152
>
for size < targetSize {
153
>
currHistoryBatches, err := i.readHistory(ctx, firstEventID)
154
>
if _, isNotFound := err.(*serviceerror.NotFound); isNotFound && firstEventID != common.FirstEventID {
155
newIterState.FinishedIteration = true
156
return historyBatches, newIterState, nil
157
}
159
return nil, newIterState, err
160
}