[backend/core] Switch to IQueryable<T>.AsChunkedAsyncEnumerable() in MediaCleanupTask
This commit is contained in:
parent
1d9864a214
commit
ca2c4f35ab
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using Iceshrimp.Backend.Core.Configuration;
|
||||
using Iceshrimp.Backend.Core.Database;
|
||||
using Iceshrimp.Backend.Core.Extensions;
|
||||
using Iceshrimp.Backend.Core.Queues;
|
||||
using Iceshrimp.Backend.Core.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -33,7 +34,7 @@ public class MediaCleanupTask : ICronTask
|
|||
var cnt = await fileIds.CountAsync();
|
||||
|
||||
logger.LogInformation("Expiring {count} files...", cnt);
|
||||
await foreach (var fileId in fileIds.AsAsyncEnumerable())
|
||||
await foreach (var fileId in fileIds.AsChunkedAsyncEnumerable(50))
|
||||
{
|
||||
await queueService.BackgroundTaskQueue.EnqueueAsync(new DriveFileDeleteJobData
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue