36
mutableState historyi.MutableState,
37
logger log.Logger,
39
>
40
>
return &BufferEventFlusherImpl{
41
>
shardContext: shardContext,
42
>
clusterMetadata: shardContext.GetClusterMetadata(),
43
>
44
>
wfContext: wfContext,
45
>
mutableState: mutableState,
46
>
logger: logger,
47
>
}
48
>
}
49
50
func (r *BufferEventFlusherImpl) flush(
51
ctx context.Context,
53
>
// check whether there are buffered events, if so, flush it
54
>
// NOTE: buffered events does not show in version history or next event id
55
>
if !r.mutableState.HasBufferedEvents() {
56
if r.mutableState.HasStartedWorkflowTask() && r.mutableState.IsTransientWorkflowTask() {
57
if err := r.mutableState.ClearTransientWorkflowTask(); err != nil {