Exemplo n.º 1
0
        /// <inheritdoc />
        public async Task StartLeasingAsync(CancellationToken cancellationToken = default)
        {
            try
            {
                await HandleExistingLeaseAsync(cancellationToken).ConfigureAwait(false);

                await _timer.ExecutePeriodicallyInAsync(
                    _slottedInterval.Calculate(ServerDateTime.UtcNow, _options.Value.LeaseInterval),
                    (token) => OperationTelemetryHandler(LeaseAsync, token), cancellationToken);
            }
            catch (OperationCanceledException)
            {
                await Task.CompletedTask;
            }
        }