✨ Marking views
This commit is contained in:
@ -195,6 +195,7 @@ builder.Services.AddSingleton<FlushBufferService>();
|
||||
builder.Services.AddScoped<ActionLogFlushHandler>();
|
||||
builder.Services.AddScoped<MessageReadReceiptFlushHandler>();
|
||||
builder.Services.AddScoped<LastActiveFlushHandler>();
|
||||
builder.Services.AddScoped<PostViewFlushHandler>();
|
||||
|
||||
// The handlers for websocket
|
||||
builder.Services.AddScoped<IWebSocketPacketHandler, MessageReadHandler>();
|
||||
@ -282,6 +283,16 @@ builder.Services.AddQuartz(q =>
|
||||
.WithIntervalInMinutes(5)
|
||||
.RepeatForever())
|
||||
);
|
||||
|
||||
var postViewFlushJob = new JobKey("PostViewFlush");
|
||||
q.AddJob<PostViewFlushJob>(opts => opts.WithIdentity(postViewFlushJob));
|
||||
q.AddTrigger(opts => opts
|
||||
.ForJob(postViewFlushJob)
|
||||
.WithIdentity("PostViewFlushTrigger")
|
||||
.WithSimpleSchedule(o => o
|
||||
.WithIntervalInMinutes(1)
|
||||
.RepeatForever())
|
||||
);
|
||||
});
|
||||
builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
|
||||
|
||||
|
Reference in New Issue
Block a user