/
aprogrammer
/
reverse-proxy-ms-yarp
Обзор
Документация
Войти
/
aprogrammer
/
reverse-proxy-ms-yarp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/ReverseProxy/Configuration/PassiveHealthCheckConfig.cs
46 строк
1 KB
Kahbazi
Use is null instead of == null (#1565)
29 мар 2022, 02:51
Не верифицирован
29 мар 2022, 02:51
9bbdf5e
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; namespace Yarp.ReverseProxy.Configuration; /// <summary> /// Passive health check config. /// </summary> public sealed record PassiveHealthCheckConfig { /// <summary> /// Whether passive health checks are enabled. /// </summary> public bool? Enabled { get; init; } /// <summary> /// Passive health check policy. /// </summary> public string? Policy { get; init; } /// <summary> /// Destination reactivation period after which an unhealthy destination is considered healthy again. /// </summary> public TimeSpan? ReactivationPeriod { get; init; } public bool Equals(PassiveHealthCheckConfig? other) { if (other is null) { return false; } return Enabled == other.Enabled && string.Equals(Policy, other.Policy, StringComparison.OrdinalIgnoreCase) && ReactivationPeriod == other.ReactivationPeriod; } public override int GetHashCode() { return HashCode.Combine(Enabled, Policy?.GetHashCode(StringComparison.OrdinalIgnoreCase), ReactivationPeriod); } }