mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-22 00:54:26 +08:00
0.6.8
小黑板数据持久化。
This commit is contained in:
@@ -43,6 +43,7 @@ sealed class Program
|
||||
|
||||
var diagnostics = StartupDiagnosticsService.Run(args);
|
||||
StartupDiagnosticsService.ShowLegacyExecutableWarningIfNeeded(diagnostics);
|
||||
ScheduleWhiteboardNoteStartupCleanup();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -88,6 +89,25 @@ sealed class Program
|
||||
return builder;
|
||||
}
|
||||
|
||||
private static void ScheduleWhiteboardNoteStartupCleanup()
|
||||
{
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var deletedCount = new WhiteboardNotePersistenceService().DeleteExpiredNotesBatch(batchSize: 512);
|
||||
if (deletedCount > 0)
|
||||
{
|
||||
AppLogger.Info("Startup", $"Deleted {deletedCount} expired whiteboard notes during startup maintenance.");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
AppLogger.Warn("Startup", "Failed to run whiteboard note startup maintenance.", ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static SingleInstanceService AcquireSingleInstance(int? restartParentProcessId)
|
||||
{
|
||||
var singleInstance = SingleInstanceService.CreateDefault();
|
||||
|
||||
Reference in New Issue
Block a user