private RangeBlock GenerateNumericRangeBlock(NumericRangeBlockRequest blockRequest, long rangeBegin, long rangeEnd) { var request = new RangeBlockCreateRequest(new TaskId(blockRequest.ApplicationName, blockRequest.TaskName), blockRequest.TaskExecutionId, rangeBegin, rangeEnd); var rangeBlock = _blockRepository.AddRangeBlock(request).Block; Thread.Sleep(5); // guarantee that each block has a unique created date return(rangeBlock); }
private async Task <RangeBlock> GenerateNumericRangeBlockAsync(NumericRangeBlockRequest blockRequest, long rangeBegin, long rangeEnd) { var request = new RangeBlockCreateRequest(new TaskId(blockRequest.ApplicationName, blockRequest.TaskName), blockRequest.TaskExecutionId, rangeBegin, rangeEnd); var rangeBlock = (await _blockRepository.AddRangeBlockAsync(request).ConfigureAwait(false)).Block; await Task.Delay(10).ConfigureAwait(false); // guarantee that each block has a unique created date return(rangeBlock); }