8159
// capTombstoneCount limits the total number of tombstones stored in the mutable state.
8160
// This method should be called whenever tombstone batch list is updated or synced.
8162
>
tombstoneCountLimit := ms.config.MutableStateTombstoneCountLimit()
8163
>
for ms.totalTombstones > tombstoneCountLimit &&
8164
>
len(ms.executionInfo.SubStateMachineTombstoneBatches) > 0 {
8165
ms.totalTombstones -= len(ms.executionInfo.SubStateMachineTombstoneBatches[0].StateMachineTombstones)
8166
ms.executionInfo.SubStateMachineTombstoneBatches = ms.executionInfo.SubStateMachineTombstoneBatches[1:]