perf: 热更新资源改为异步加载避免启动阻塞

This commit is contained in:
uye
2025-04-09 16:58:37 +08:00
parent be7f4f999d
commit ad077a9f33

View File

@@ -46,7 +46,7 @@ namespace MaaWpfGui.Services
private static readonly ILogger _logger = Log.ForContext<StageManager>();
// data
private Dictionary<string, StageInfo> _stages;
private Dictionary<string, StageInfo> _stages = [];
/// <summary>
/// Initializes a new instance of the <see cref="StageManager"/> class.
@@ -158,7 +158,10 @@ namespace MaaWpfGui.Services
await Instances.MaaApiService.RequestMaaApiWithCache(tasksPath);
}
Instances.AsstProxy.LoadResource();
await Task.Run(() =>
{
Instances.AsstProxy.LoadResource();
});
return activity;
}