Updated appsettings for the worker app. Added split querying for updaters.
This commit is contained in:
@@ -11,13 +11,14 @@ public class VoiceWorkSearchUpdater(AppDbContext dbContext) : IVoiceWorkSearchUp
|
|||||||
public async Task UpdateAsync(int[] voiceWorkIds, CancellationToken cancellationToken)
|
public async Task UpdateAsync(int[] voiceWorkIds, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
List<VoiceWork> batch = await dbContext.VoiceWorks
|
List<VoiceWork> batch = await dbContext.VoiceWorks
|
||||||
|
.Where(vw => voiceWorkIds.Contains(vw.VoiceWorkId))
|
||||||
|
.AsSplitQuery()
|
||||||
.Include(vw => vw.Circle)
|
.Include(vw => vw.Circle)
|
||||||
.Include(vw => vw.Tags)
|
.Include(vw => vw.Tags)
|
||||||
.ThenInclude(vwt => vwt.Tag)
|
.ThenInclude(vwt => vwt.Tag)
|
||||||
.Include(vw => vw.Creators)
|
.Include(vw => vw.Creators)
|
||||||
.ThenInclude(vwc => vwc.Creator)
|
.ThenInclude(vwc => vwc.Creator)
|
||||||
.Include(vw => vw.EnglishVoiceWorks)
|
.Include(vw => vw.EnglishVoiceWorks)
|
||||||
.Where(vw => voiceWorkIds.Contains(vw.VoiceWorkId))
|
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
foreach (var voiceWork in batch)
|
foreach (var voiceWork in batch)
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class VoiceWorkUpdater(AppDbContext dbContext, ITimeProvider timeProvider
|
|||||||
.ToDictionaryAsync(c => c.MakerId, cancellationToken),
|
.ToDictionaryAsync(c => c.MakerId, cancellationToken),
|
||||||
VoiceWorks: await dbContext.VoiceWorks
|
VoiceWorks: await dbContext.VoiceWorks
|
||||||
.Where(v => productIds.Contains(v.ProductId))
|
.Where(v => productIds.Contains(v.ProductId))
|
||||||
|
.AsSplitQuery()
|
||||||
.Include(v => v.Creators)
|
.Include(v => v.Creators)
|
||||||
.Include(v => v.Tags)
|
.Include(v => v.Tags)
|
||||||
.Include(v => v.Localizations)
|
.Include(v => v.Localizations)
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
{
|
{
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
/*"Default": "Information",*/
|
"Default": "Information",
|
||||||
"Default": "Warning",
|
|
||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.AspNetCore": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information",
|
||||||
|
|
||||||
|
"Microsoft.EntityFrameworkCore": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore.Database.Command": "None",
|
||||||
|
|
||||||
|
"System.Net.Http.HttpClient": "Warning",
|
||||||
|
"Polly": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
|
|||||||
@@ -2,7 +2,16 @@
|
|||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.AspNetCore": "Warning"
|
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.AspNetCore": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information",
|
||||||
|
|
||||||
|
"Microsoft.EntityFrameworkCore": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore.Database.Command": "None",
|
||||||
|
|
||||||
|
"System.Net.Http.HttpClient": "Warning",
|
||||||
|
"Polly": "Warning"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user