mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-11 12:14:30 +08:00
fix(game): 修复 SettingsModel 的 MA0004 警告
- 修复 SettingsModel 中异步仓储加载与保存流程缺少 ConfigureAwait(false) 的 analyzer 警告 - 保持设置模型初始化、保存、应用阶段的生命周期与事件触发语义不变
This commit is contained in:
parent
fb0a55f435
commit
c106e53a74
@ -169,7 +169,7 @@ public class SettingsModel<TRepository>(IDataLocationProvider? locationProvider,
|
||||
|
||||
try
|
||||
{
|
||||
allData = await DataRepository.LoadAllAsync();
|
||||
allData = await DataRepository.LoadAllAsync().ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -213,7 +213,7 @@ public class SettingsModel<TRepository>(IDataLocationProvider? locationProvider,
|
||||
try
|
||||
{
|
||||
var location = LocationProvider.GetLocation(data.GetType());
|
||||
await DataRepository.SaveAsync(location, data);
|
||||
await DataRepository.SaveAsync(location, data).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -231,7 +231,7 @@ public class SettingsModel<TRepository>(IDataLocationProvider? locationProvider,
|
||||
foreach (var applicator in _applicators)
|
||||
try
|
||||
{
|
||||
await applicator.Value.ApplyAsync();
|
||||
await applicator.Value.ApplyAsync().ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user