Nullify SwarmUpdateOperation

This commit is contained in:
Jordan Dominion
2023-11-25 15:05:56 -05:00
parent af0f05d8bf
commit 1e21ef20b8
@@ -6,8 +6,6 @@ using System.Threading.Tasks;
using Tgstation.Server.Api.Models.Internal;
using Tgstation.Server.Api.Models.Response;
#nullable disable
namespace Tgstation.Server.Host.Swarm
{
/// <summary>
@@ -33,7 +31,7 @@ namespace Tgstation.Server.Host.Swarm
/// <summary>
/// Backing field for <see cref="InvolvedServers"/>.
/// </summary>
readonly IReadOnlyList<SwarmServerResponse> initialInvolvedServers;
readonly IReadOnlyList<SwarmServerResponse>? initialInvolvedServers;
/// <summary>
/// The backing <see cref="TaskCompletionSource{TResult}"/> for <see cref="CommitGate"/>.
@@ -43,7 +41,7 @@ namespace Tgstation.Server.Host.Swarm
/// <summary>
/// <see cref="HashSet{T}"/> of <see cref="SwarmServer.Identifier"/> that need to send a ready-commit to the controller before the commit can happen.
/// </summary>
readonly HashSet<string> nodesThatNeedToBeReadyToCommit;
readonly HashSet<string>? nodesThatNeedToBeReadyToCommit;
/// <summary>
/// Initializes a new instance of the <see cref="SwarmUpdateOperation"/> class.
@@ -68,7 +66,7 @@ namespace Tgstation.Server.Host.Swarm
initialInvolvedServers = currentNodes?.ToList() ?? throw new ArgumentNullException(nameof(currentNodes));
nodesThatNeedToBeReadyToCommit = initialInvolvedServers
.Where(node => !node.Controller)
.Select(node => node.Identifier)
.Select(node => node.Identifier!)
.ToHashSet();
}