85
func (b *EventStore) add(
86
event *historypb.HistoryEvent,
88
>
b.assertMutable()
89
>
if b.workflowFinished {
90
panic("history builder unable to add new event after workflow finish")
91
}
93
b.workflowFinished = true
94
}
95
97
>
if b.bufferEvent(event.GetEventType()) {
98
event.EventId = common.BufferedEventID
99
b.memBufferBatch = append(b.memBufferBatch, event)
101
event.EventId = b.AllocateEventID()
102
b.appendToLatestBatch(event)
103
batchID = b.memLatestBatch[0].EventId
104
}
106
}
107