⚡ Trying to optimize the scheduled jobs
This commit is contained in:
@@ -10,27 +10,24 @@ public static class ScheduledJobsConfiguration
|
|||||||
{
|
{
|
||||||
services.AddQuartz(q =>
|
services.AddQuartz(q =>
|
||||||
{
|
{
|
||||||
var appDatabaseRecyclingJob = new JobKey("AppDatabaseRecycling");
|
q.AddJob<AppDatabaseRecyclingJob>(opts => opts.WithIdentity("AppDatabaseRecycling"));
|
||||||
q.AddJob<AppDatabaseRecyclingJob>(opts => opts.WithIdentity(appDatabaseRecyclingJob));
|
|
||||||
q.AddTrigger(opts => opts
|
q.AddTrigger(opts => opts
|
||||||
.ForJob(appDatabaseRecyclingJob)
|
.ForJob("AppDatabaseRecycling")
|
||||||
.WithIdentity("AppDatabaseRecyclingTrigger")
|
.WithIdentity("AppDatabaseRecyclingTrigger")
|
||||||
.WithCronSchedule("0 0 0 * * ?"));
|
.WithCronSchedule("0 0 0 * * ?"));
|
||||||
|
|
||||||
var postViewFlushJob = new JobKey("PostViewFlush");
|
q.AddJob<PostViewFlushJob>(opts => opts.WithIdentity("PostViewFlush"));
|
||||||
q.AddJob<PostViewFlushJob>(opts => opts.WithIdentity(postViewFlushJob));
|
|
||||||
q.AddTrigger(opts => opts
|
q.AddTrigger(opts => opts
|
||||||
.ForJob(postViewFlushJob)
|
.ForJob("PostViewFlush")
|
||||||
.WithIdentity("PostViewFlushTrigger")
|
.WithIdentity("PostViewFlushTrigger")
|
||||||
.WithSimpleSchedule(o => o
|
.WithSimpleSchedule(o => o
|
||||||
.WithIntervalInMinutes(1)
|
.WithIntervalInMinutes(1)
|
||||||
.RepeatForever())
|
.RepeatForever())
|
||||||
);
|
);
|
||||||
|
|
||||||
var webFeedScraperJob = new JobKey("WebFeedScraper");
|
q.AddJob<WebFeedScraperJob>(opts => opts.WithIdentity("WebFeedScraper").StoreDurably());
|
||||||
q.AddJob<WebFeedScraperJob>(opts => opts.WithIdentity(webFeedScraperJob).StoreDurably());
|
|
||||||
q.AddTrigger(opts => opts
|
q.AddTrigger(opts => opts
|
||||||
.ForJob(webFeedScraperJob)
|
.ForJob("WebFeedScraper")
|
||||||
.WithIdentity("WebFeedScraperTrigger")
|
.WithIdentity("WebFeedScraperTrigger")
|
||||||
.WithCronSchedule("0 0 0 * * ?")
|
.WithCronSchedule("0 0 0 * * ?")
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user