From 1ee1f1b12b7608bd05ac0a4f4b25457c941c6508 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 7 Aug 2023 15:23:11 +0800 Subject: [PATCH] Enable nullable annotations for Volo.Abp.DistributedLocking.Abstractions --- .../Volo.Abp.DistributedLocking.Abstractions.csproj | 2 ++ .../Volo/Abp/DistributedLocking/IAbpDistributedLock.cs | 3 +-- .../Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj index 7e01d295e7..e53f5b718c 100644 --- a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj +++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj @@ -5,6 +5,8 @@ netstandard2.0;netstandard2.1;net7.0 + enable + Nullable Volo.Abp.DistributedLocking.Abstractions Volo.Abp.DistributedLocking.Abstractions $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs index 754ae807f8..1d1b5e01db 100644 --- a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs +++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs @@ -16,8 +16,7 @@ public interface IAbpDistributedLock /// The name of the lock /// How long to wait before giving up on the acquisition attempt. Defaults to 0 /// Cancellation token - [ItemCanBeNull] - Task TryAcquireAsync( + Task TryAcquireAsync( [NotNull] string name, TimeSpan timeout = default, CancellationToken cancellationToken = default diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs index 490f024d36..58d67e1caf 100644 --- a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs +++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs @@ -22,7 +22,7 @@ public class LocalAbpDistributedLock : IAbpDistributedLock, ISingletonDependency } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public async Task TryAcquireAsync( + public async Task TryAcquireAsync( string name, TimeSpan timeout = default, CancellationToken cancellationToken = default)