RobotStatusSync.cs
2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
namespace Rcs.Domain.Settings
{
/// <summary>
/// Robot状态管理配置
/// </summary>
public record RobotStatusSync
{
/// <summary>
/// Redis TTL(秒)- Robot状态在Redis中的过期时间
/// </summary>
public int RedisTtlSeconds { get; init; } = 60;
/// <summary>
/// 启用Redis压缩
/// </summary>
public bool EnableRedisCompression { get; init; } = false;
/// <summary>
/// 数据库同步间隔(毫秒)
/// </summary>
public int DbSyncIntervalMs { get; init; } = 3000;
/// <summary>
/// 数据库同步批次大小
/// </summary>
public int DbSyncBatchSize { get; init; } = 100;
/// <summary>
/// 启用智能同步(只同步有显著变化的数据)
/// </summary>
public bool EnableSmartSync { get; init; } = true;
/// <summary>
/// 位置变化阈值(米)- 超过此值才同步
/// </summary>
public double PositionChangeThreshold { get; init; } = 0.1;
/// <summary>
/// 电池电量变化阈值(%)- 超过此值才同步
/// </summary>
public double BatteryChangeThreshold { get; init; } = 1.0;
/// <summary>
/// 启用Redis管道批处理
/// </summary>
public bool EnableRedisPipeline { get; init; } = true;
/// <summary>
/// 管道批次大小
/// </summary>
public int PipelineBatchSize { get; init; } = 50;
/// <summary>
/// 管道刷新间隔(毫秒)
/// </summary>
public int PipelineFlushIntervalMs { get; init; } = 50;
/// <summary>
/// 启用启动预热
/// </summary>
public bool EnableStartupPrewarm { get; init; } = true;
/// <summary>
/// 预热最大Robot数量
/// </summary>
public int PrewarmMaxRobots { get; init; } = 1000;
/// <summary>
/// 关闭配置
/// </summary>
public GracefulShutdownSettings GracefulShutdown { get; init; } = new();
}
/// <summary>
/// 关闭配置
/// </summary>
public record GracefulShutdownSettings
{
/// <summary>
/// 启用关闭
/// </summary>
public bool Enabled { get; init; } = true;
/// <summary>
/// 超时时间(秒)
/// </summary>
public int TimeoutSeconds { get; init; } = 30;
/// <summary>
/// 保存同步报告到文件
/// </summary>
public bool SaveSyncReportToFile { get; init; } = true;
/// <summary>
/// 记录详细进度
/// </summary>
public bool LogDetailedProgress { get; init; } = true;
}
}