Revert "improve:PPT模块" (#390)

This reverts commit 7d0de8b5a3.
This commit is contained in:
CJK_mkp
2026-03-05 11:30:07 +08:00
committed by GitHub
parent c9cef8ca86
commit a406778d35
2 changed files with 148 additions and 176 deletions
+4 -11
View File
@@ -1195,7 +1195,6 @@ namespace Ink_Canvas
private static DateTime startupCompleteHeartbeat = DateTime.MinValue;
private static DateTime splashScreenStartTime = DateTime.MinValue;
private static DateTime appStartupStartTime = DateTime.MinValue;
private static readonly TimeSpan StartupTimeout = TimeSpan.FromMinutes(2);
/// <summary>
/// 启动并管理应用的心跳与守护检查定时器,监测启动阶段与主线程是否无响应,并在符合配置的情况下尝试静默重启应用。
@@ -1219,8 +1218,6 @@ namespace Ink_Canvas
watchdogTimer = new Timer(_ =>
{
var now = DateTime.Now;
if (IsOobeShowing)
return;
@@ -1229,8 +1226,8 @@ namespace Ink_Canvas
DateTime startTime = _isSplashScreenShown && splashScreenStartTime != DateTime.MinValue
? splashScreenStartTime
: appStartupStartTime;
TimeSpan elapsedSinceStart = now - startTime;
if (elapsedSinceStart >= StartupTimeout)
TimeSpan elapsedSinceStart = DateTime.Now - startTime;
if (elapsedSinceStart.TotalMinutes >= 2)
{
string timeType = _isSplashScreenShown ? "启动画面已显示" : "应用启动开始";
LogHelper.WriteLogToFile($"检测到启动假死:{timeType}{elapsedSinceStart.TotalMinutes:F2}分钟,但未收到启动完成心跳,自动重启。", LogHelper.LogType.Error);
@@ -1255,12 +1252,8 @@ namespace Ink_Canvas
return;
}
}
if (isStartupComplete && (now - lastHeartbeat).TotalSeconds > 10)
if (isStartupComplete && (DateTime.Now - lastHeartbeat).TotalSeconds > 10)
{
if (appStartupStartTime != DateTime.MinValue && (now - appStartupStartTime) < StartupTimeout)
return;
LogHelper.NewLog("检测到主线程无响应,自动重启。");
SyncCrashActionFromSettings();
if (CrashAction == CrashActionType.SilentRestart)
@@ -1468,4 +1461,4 @@ namespace Ink_Canvas
}
}
}
}
}