mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Compare commits
1 Commits
1.10.0
...
refactor/h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5182fd8577 |
@@ -104,6 +104,7 @@ internal class ScopedPage : Page
|
||||
|
||||
// Dispose the scope
|
||||
pageScope.Dispose();
|
||||
GC.Collect(GC.MaxGeneration, GCCollectionMode.Aggressive, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ internal sealed partial class DailyNoteNotificationOperation
|
||||
|
||||
private readonly ITaskContext taskContext;
|
||||
private readonly IGameServiceFacade gameService;
|
||||
private readonly BindingClient bindingClient;
|
||||
private readonly IServiceScopeFactory serviceScopeFactory;
|
||||
private readonly DailyNoteOptions options;
|
||||
private readonly RuntimeOptions runtimeOptions;
|
||||
|
||||
@@ -58,14 +58,19 @@ internal sealed partial class DailyNoteNotificationOperation
|
||||
}
|
||||
else
|
||||
{
|
||||
Response<ListWrapper<UserGameRole>> rolesResponse = await bindingClient
|
||||
.GetUserGameRolesOverseaAwareAsync(entry.User)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (rolesResponse.IsOk())
|
||||
using (IServiceScope scope = serviceScopeFactory.CreateScope())
|
||||
{
|
||||
List<UserGameRole> roles = rolesResponse.Data.List;
|
||||
attribution = roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? ToastAttributionUnknown;
|
||||
BindingClient bindingClient = scope.ServiceProvider.GetRequiredService<BindingClient>();
|
||||
|
||||
Response<ListWrapper<UserGameRole>> rolesResponse = await bindingClient
|
||||
.GetUserGameRolesOverseaAwareAsync(entry.User)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (rolesResponse.IsOk())
|
||||
{
|
||||
List<UserGameRole> roles = rolesResponse.Data.List;
|
||||
attribution = roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? ToastAttributionUnknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user