Skip to content

Commit

Permalink
Allow pre-init fallbacks for displaying jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Mar 17, 2024
1 parent ef090cc commit aa8fc10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Shoko.Server/Scheduling/JobFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class JobFactory : MicrosoftDependencyInjectionJobFactory
private readonly ILoggerFactory _loggerFactory;
private readonly ILogger<JobFactory> _logger;

// Used by Quartz
public override IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
{
try
Expand Down Expand Up @@ -48,6 +49,7 @@ public override IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
}
}

// The rest used by us
public T CreateJob<T>(Action<T> ctor = null) where T : BaseJob
{
try
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit aa8fc10

Please sign in to comment.