Skip to content

Commit

Permalink
Merge pull request #711 from bcgov/BCPSDEMS-2119
Browse files Browse the repository at this point in the history
Bcpsdems 2119
  • Loading branch information
leewrigh authored Nov 4, 2024
2 parents 66c4f3b + 55be389 commit 46f195a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
4 changes: 3 additions & 1 deletion backend/jumwebapi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ public void ConfigureServices(IServiceCollection services)
services.AddQuartz(q =>
{
Log.Information("Starting ORDS Test scheduler..");
q.SchedulerId = "JUM-ORDS-TEST";
var schedulerId = $"DIAM-JUM-Scehduler-{Guid.NewGuid()}";
q.SchedulerId = schedulerId;
q.SchedulerName = "ORDS Test Scheduler";
q.UsePersistentStore(store =>
Expand Down
22 changes: 15 additions & 7 deletions backend/service.edt/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Startup(IConfiguration configuration)

public static IConfiguration StaticConfig { get; private set; }


[Obsolete]
public void ConfigureServices(IServiceCollection services)
{
var config = this.InitializeConfiguration(services);
Expand Down Expand Up @@ -238,16 +238,27 @@ public void ConfigureServices(IServiceCollection services)
services.AddQuartz(q =>
{
Log.Information("Starting scheduler..");
q.SchedulerId = "Folio-Linkage-Scheduler";
q.SchedulerName = "DIAM Scheduler";
var schedulerId = $"DIAM-EDT-Scheduler-{Guid.NewGuid()}";
q.SchedulerId = schedulerId;
q.SchedulerName = "DIAM EDT Scheduler";
q.UsePersistentStore(store =>
{
q.UseDefaultThreadPool(tp =>
{
tp.MaxConcurrency = 3;
});
store.UseClustering(c =>
{
c.CheckinMisfireThreshold = TimeSpan.FromSeconds(15);
c.CheckinInterval = TimeSpan.FromSeconds(10);
});
// Use for PostgresSQL database
store.UsePostgres(pgOptions =>
{
pgOptions.UseDriverDelegate<PostgreSQLDelegate>();
pgOptions.ConnectionString = config.ConnectionStrings.EdtDataStore;
pgOptions.ConnectionString = $"{config.ConnectionStrings.EdtDataStore};MaxConnections=3";
pgOptions.TablePrefix = "quartz.qrtz_";
});
store.UseJsonSerializer();
Expand All @@ -265,9 +276,6 @@ public void ConfigureServices(IServiceCollection services)
.WithDescription("Court access scheduled event")
.WithCronSchedule(config.FolioLinkageBackgroundService.PollCron));
});


Expand Down
16 changes: 14 additions & 2 deletions backend/webapi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,24 @@ public void ConfigureServices(IServiceCollection services)

services.AddQuartz(q =>
{
Log.Information("Starting scheduler..");
q.SchedulerId = "Court-Access-Core";
var schedulerId = $"DIAM-Quartz-Scehduler-{Guid.NewGuid()}";
q.SchedulerId = schedulerId;
q.SchedulerName = "DIAM Scheduler";
q.UseDefaultThreadPool(tp =>
{
tp.MaxConcurrency = 3;
});
q.UsePersistentStore(store =>
{
store.UseClustering(c =>
{
c.CheckinMisfireThreshold = TimeSpan.FromSeconds(15);
c.CheckinInterval = TimeSpan.FromSeconds(10);
});
// Use for PostgresSQL database
store.UsePostgres(pgOptions =>
{
Expand All @@ -273,7 +285,7 @@ public void ConfigureServices(IServiceCollection services)
// Create a "key" for the job
var jobKey = new JobKey("Court access trigger");
q.AddJob<CourtAccessScheduledJob>(opts => opts.WithIdentity(jobKey));
q.AddJob<CourtAccessScheduledJob>(opts => { opts.WithIdentity(jobKey); });
Log.Information($"Scheduling CourtAccessScheduledJob with params [{config.CourtAccess.PollCron}]");
Expand Down

0 comments on commit 46f195a

Please sign in to comment.