⚡ Sped up and reduce storage usage of read receipt
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using DysonNetwork.Sphere.Account;
|
||||
using EFCore.BulkExtensions;
|
||||
using Quartz;
|
||||
|
||||
namespace DysonNetwork.Sphere.Storage.Handlers;
|
||||
|
||||
@ -9,7 +10,15 @@ public class ActionLogFlushHandler(IServiceProvider serviceProvider) : IFlushHan
|
||||
{
|
||||
using var scope = serviceProvider.CreateScope();
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDatabase>();
|
||||
|
||||
|
||||
await db.BulkInsertAsync(items);
|
||||
}
|
||||
}
|
||||
|
||||
public class ActionLogFlushJob(FlushBufferService fbs, ActionLogFlushHandler hdl) : IJob
|
||||
{
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
await fbs.FlushAsync(hdl);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user