diff --git a/Shoko.Server/Scheduling/JobFactory.cs b/Shoko.Server/Scheduling/JobFactory.cs index 0de1eabd1..6294612bb 100644 --- a/Shoko.Server/Scheduling/JobFactory.cs +++ b/Shoko.Server/Scheduling/JobFactory.cs @@ -17,6 +17,7 @@ public class JobFactory : MicrosoftDependencyInjectionJobFactory private readonly ILoggerFactory _loggerFactory; private readonly ILogger _logger; + // Used by Quartz public override IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler) { try @@ -48,6 +49,7 @@ public override IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler) } } + // The rest used by us public T CreateJob(Action ctor = null) where T : BaseJob { try @@ -100,10 +102,9 @@ public BaseJob CreateJob(IJobDetail jobDetails) job.PostInit(); return job; } - catch (Exception e) + catch { - _logger.LogError(e, "There was an error initializing Job: {Key}", jobDetails.Key); - throw; + return null; } }