Ignore:
Timestamp:
09/18/22 18:09:53 (2 years ago)
Author:
Danilo <danilo.najkov@…>
Branches:
master
Parents:
49b0bbd
Message:

vip functionallity + menu fields + alergens filtering + google/fb login + email queueing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • resTools_backend/backend/Program.cs

    r49b0bbd r13f1472  
    22using backend.Email;
    33using backend.Helpers;
     4using backend.Jobs;
    45using backend.Services;
    56using Microsoft.EntityFrameworkCore;
    67using Microsoft.OpenApi.Models;
     8using Quartz;
    79using WebApi.Helpers;
    810
     
    5658builder.Services.AddDbContext<DataContext>(p => p.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
    5759
     60builder.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
     73IServiceCollection serviceCollection = builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
     74
    5875var app = builder.Build();
    5976
Note: See TracChangeset for help on using the changeset viewer.