feat(launcher): SimpleLite 进程独立化与 DLL 热更新

- FollowParent=false 时在 Windows 用 cmd /c start 脱离父进程组,关闭 MiGu.Server 不再连带结束 SimpleLite
- 新增 SimpleLiteBuildSync:SimpleLite 未运行时把 obj/Debug 最新 DLL 同步到 bin/Debug,并探测「前往站点」API 是否可用
- 新增 RestartForUpdate 与 POST /api/health/simplelite/restart-for-update:一键关闭、同步、重启以加载新 API
- 诊断增加 FollowParent / GotoSiteApiAvailable / DeployHint;新增 scripts/redeploy-simplelite.ps1 部署脚本
- Dispose 增加 _disposed 幂等保护,避免重复释放
This commit is contained in:
zhaowei.huang
2026-05-29 23:51:23 +08:00
parent a5dd632898
commit 37680a0ae7
4 changed files with 326 additions and 47 deletions
+14 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using MiGu.Server.Launcher;
namespace MiGu.Server.Controllers;
@@ -39,4 +40,16 @@ public class HealthController : ControllerBase
/// </summary>
[HttpGet("simplelite")]
public IActionResult GetSimpleLiteDiagnostics() => Ok(_launcher.GetDiagnostics());
/// <summary>
/// 关闭 SimpleLite、同步最新 DLL、重新拉起。用于「前往站点」API 缺失时一键更新。
/// </summary>
[HttpPost("simplelite/restart-for-update")]
[Authorize]
public IActionResult RestartSimpleLiteForUpdate([FromQuery] string launchMode = "webonly")
{
var result = _launcher.RestartForUpdate(launchMode);
var diag = _launcher.GetDiagnostics();
return Ok(new { restart = result, diagnostics = diag });
}
}