mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 16:06:30 +00:00
add quartz for jobs
configure auto-scan folder and create hls files job WIP
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
using System.Collections.Specialized;
|
||||
using Azaion.Repository;
|
||||
using Azaion.Repository.DTO;
|
||||
using Azaion.Repository.DTO.Configs;
|
||||
using Azaion.Video;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Quartz;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
|
||||
@@ -22,9 +25,23 @@ builder.Services.AddControllers();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
builder.Services.Configure<FoldersConfig>(builder.Configuration.GetSection(nameof(FoldersConfig)));
|
||||
builder.Services.Configure<ConnectionStrings>(builder.Configuration.GetSection(nameof(ConnectionStrings)));
|
||||
builder.Services.AddSingleton<IDbFactory, DbFactory>(sp => new DbFactory(sp.GetService<IOptions<ConnectionStrings>>()!.Value.FraudDb!));
|
||||
builder.Services.AddScoped<IVideoManager, VideoManager>();
|
||||
builder.Services.AddScoped<IVideoRepository, VideoRepository>();
|
||||
|
||||
var connStr = builder.Configuration.Get<ConnectionStrings>();
|
||||
|
||||
builder.Services.AddQuartz(q =>
|
||||
{
|
||||
q.SchedulerId = "AzaionScheduler";
|
||||
q.SchedulerName = "Azaion Scheduler";
|
||||
q.UsePersistentStore(c =>
|
||||
{
|
||||
c.UseNewtonsoftJsonSerializer();
|
||||
c.UseMySql(connStr.FraudDbMsSql);
|
||||
});
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -37,4 +54,4 @@ if (app.Environment.IsDevelopment())
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.MapControllers();
|
||||
app.Run();
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user