示例#1
0
        private Checkpoint GetCheckpoint(Shard shard)
        {
            _logger.LogInformation("Loading checkpoint for shard: {0}", shard.ShardId);
            Checkpoint checkPoint = _checkpointRepository.Load(shard.ShardId, _streamName, _readerName);

            if (checkPoint == null)
            {
                _logger.LogWarning("No checkpoint for shard: {0}. Creating one.", shard.ShardId);
                checkPoint = new Checkpoint(shard, _streamName, _readerName);
                _checkpointRepository.Save(checkPoint);
            }

            return(checkPoint);
        }