Changeset 13f1472 for resTools_backend/backend/Program.cs
- Timestamp:
- 09/18/22 18:09:53 (2 years ago)
- Branches:
- master
- Parents:
- 49b0bbd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
resTools_backend/backend/Program.cs
r49b0bbd r13f1472 2 2 using backend.Email; 3 3 using backend.Helpers; 4 using backend.Jobs; 4 5 using backend.Services; 5 6 using Microsoft.EntityFrameworkCore; 6 7 using Microsoft.OpenApi.Models; 8 using Quartz; 7 9 using WebApi.Helpers; 8 10 … … 56 58 builder.Services.AddDbContext<DataContext>(p => p.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"))); 57 59 60 builder.Services.AddQuartz(q => 61 { 62 q.UseMicrosoftDependencyInjectionScopedJobFactory(); 63 var jobKey = new JobKey("QueueJob"); 64 q.AddJob<QueueJob>(opts => opts.WithIdentity(jobKey)); 65 66 q.AddTrigger(opts => opts 67 .ForJob(jobKey) 68 .WithIdentity("QueueJob-trigger") 69 .WithCronSchedule("0 0/1 * * * ?")); 70 71 }); 72 73 IServiceCollection serviceCollection = builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true); 74 58 75 var app = builder.Build(); 59 76
Note:
See TracChangeset
for help on using the changeset viewer.