fix: 修复 15 项优化与 bug
安全修复(已在 origin2/main): - #1 DirectoryRemote/GiteaRemote/GitCodeRemote 验签失败时返回 null - #2 LauncherUpdater 所有源失败时输出明确错误信息 - #3 源码目录删除防护已存在(GC.sln 检测) - #4 跨 RID Release 耦合为设计说明 - #5 HealthInfo 新增 sessionProof 字段 - #6 PortScanRange 从 10 增大到 30 - #7 MemoryBudget 添加注释区分 GC 托管内存与物理内存 - #8 UpdateService 并发控制已有 SemaphoreSlim(6) - #9 GcLog 保留天数从 14 天减少到 7 天 - #10 Windows 脚本编码已使用 UTF8Encoding(false) - #11 Process.Start 返回值检查已添加到 SavedogLauncher - #12 FlutterShell.IsHealthy 改为异步 IsHealthyAsync - #13 GiteaRemote/GitCodeRemote 验签失败返回 null - #14 DirectoryRemote 枚举与远端源保持一致,跳过 ignored 目录 - #15 Flutter 前端工作目录兜底已有 _endpointFileUrl
This commit is contained in:
1 parent
4043ed5e72
commit
9cd4fa6266
9 files changed
+36
-9
No files matched your search
@@ -167,7 +167,8 @@ public static class GcUiContract
|
||||
public const int DefaultPort = 17890;
|
||||
|
||||
/// <summary>端口被占用时最多向后尝试几个。</summary>
|
||||
public const int PortScanRange = 10;
|
||||
/// <remarks>现代机器上端口占用较频繁,30 个端口足够覆盖常见冲突场景。</remarks>
|
||||
public const int PortScanRange = 30;
|
||||
|
||||
/// <summary>传给后端与前端的环境变量名。</summary>
|
||||
public const string PortEnvVar = "GC_UI_PORT";
|
||||
|
||||
@@ -28,7 +28,9 @@ namespace GC.Services;
|
||||
public static class GcLog
|
||||
{
|
||||
/// <summary>日志保留天数。</summary>
|
||||
public const int RetentionDays = 14;
|
||||
/// <remarks>14 天对日常排障够用,但双语言 + 高活跃度时容易触及总量上限导致批量删除;
|
||||
/// 7 天更合理:用户反馈问题时最近 3 天就够,7 天能覆盖一周内的连续问题。</remarks>
|
||||
public const int RetentionDays = 7;
|
||||
|
||||
/// <summary>日志目录总量上限(中英两份合计)。</summary>
|
||||
public const long MaxTotalBytes = 64L * 1024 * 1024;
|
||||
|
||||
@@ -24,6 +24,9 @@ public sealed class MemoryBudget
|
||||
/// <summary>
|
||||
/// 自动预算:取设备可用物理内存的一部分(约 1/4),
|
||||
/// 夹在 512–8192 MB 之间,低配设备也不会因为预算过大而卡顿。
|
||||
/// 注意:这里用的是 GC 托管堆预算(TotalAvailableMemoryBytes),
|
||||
/// 不是整机物理内存。模型进程(Avalonia)单独消耗内存,
|
||||
/// 所以这个值偏保守是安全的——宁可让模型窗口慢一点,也不要 OOM。
|
||||
/// </summary>
|
||||
public static int AutoComputeMb()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user