Files
Ayay/SHH.CameraSdk/Abstractions/Errors/RecoveryAction.cs

55 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace SHH.CameraSdk;
/// <summary>
/// 故障恢复决策建议枚举
/// 核心职责:定义标准化的故障自愈动作指令,指导 <see cref="RecoveryPolicy"/> 与 <see cref="BaseVideoSource"/> 执行差异化恢复逻辑
/// 设计原则:按“无动作→自动恢复→降级→致命停止→人工介入”的优先级划分,覆盖全场景故障处理
/// </summary>
public enum RecoveryAction
{
#region --- 0. ---
/// <summary>
/// 正常状态,无需执行任何恢复动作
/// 适用场景:错误码为 Success、设备运行正常
/// </summary>
None,
#endregion
#region --- 1. ---
/// <summary>
/// 自动指数退避重试
/// 适用场景:网络抖动、超时、设备资源繁忙等**暂时性故障**
/// 执行标准:采用 2^n * 1000ms 算法计算延迟,上限 2 分钟,避免频繁重试加剧系统负载
/// </summary>
RetryWithBackoff,
/// <summary>
/// 降级运行
/// 适用场景:主码流超限、高清分辨率不支持等**非致命功能降级场景**
/// 执行标准自动切换到备用方案如主码流→子码流、4K→1080P保证基础功能可用
/// </summary>
Degrade,
#endregion
#region --- 2. ---
/// <summary>
/// 致命停止,禁止继续重试
/// 适用场景密码错误、账号锁定、IP 拉黑等**不可自愈的认证/权限类故障**
/// 执行标准:立即停止自愈引擎,推送告警信息到运维平台,记录详细错误日志
/// </summary>
FatalStop,
/// <summary>
/// 需要人工介入处理
/// 适用场景硬件故障、磁盘满、SDK 组件缺失等**软件无法修复的底层故障**
/// 执行标准:触发告警通知,标记设备状态为 Faulted等待运维人员排查
/// </summary>
ManualIntervention
#endregion
}