mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 19:46:29 +00:00
add quartz for jobs
configure auto-scan folder and create hls files job WIP
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Quartz;
|
||||
|
||||
namespace Azaion.Repository.Jobs
|
||||
{
|
||||
[DisallowConcurrentExecution]
|
||||
public abstract class BaseJob(ILogger<BaseJob> logger) : IJob
|
||||
{
|
||||
protected abstract Task ExecuteInner(IJobExecutionContext context);
|
||||
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
logger.LogDebug($"Start {GetType().Name}");
|
||||
|
||||
try
|
||||
{
|
||||
await ExecuteInner(context);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.LogError(e, e.Message);
|
||||
throw;
|
||||
}
|
||||
|
||||
logger.LogDebug($"{GetType().Name} Finished");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user