Action logs

This commit is contained in:
2025-05-16 01:41:24 +08:00
parent 6358c49090
commit aabe8269f5
16 changed files with 4036 additions and 52 deletions

View File

@ -148,11 +148,14 @@ builder.Services.AddSingleton(tusDiskStore);
builder.Services.AddScoped<IWebSocketPacketHandler, MessageReadHandler>();
// Services
builder.Services.Configure<GeoIpOptions>(builder.Configuration.GetSection("GeoIP"));
builder.Services.AddScoped<GeoIpService>();
builder.Services.AddScoped<WebSocketService>();
builder.Services.AddScoped<EmailService>();
builder.Services.AddScoped<PermissionService>();
builder.Services.AddScoped<AccountService>();
builder.Services.AddScoped<AccountEventService>();
builder.Services.AddSingleton<ActionLogService>();
builder.Services.AddScoped<RelationshipService>();
builder.Services.AddScoped<MagicSpellService>();
builder.Services.AddScoped<NotificationService>();
@ -188,6 +191,16 @@ builder.Services.AddQuartz(q =>
.WithIdentity("CloudFilesUnusedRecyclingTrigger")
.WithSimpleSchedule(o => o.WithIntervalInHours(1).RepeatForever())
);
var actionLogFlushJob = new JobKey("ActionLogFlush");
q.AddJob<ActionLogFlushJob>(opts => opts.WithIdentity(actionLogFlushJob));
q.AddTrigger(opts => opts
.ForJob(actionLogFlushJob)
.WithIdentity("ActionLogFlushTrigger")
.WithSimpleSchedule(o => o
.WithIntervalInMinutes(5)
.RepeatForever())
);
});
builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);