private static Action CreateJobAction(IJob job, JobParameters jobParameters, JobExecution jobExecution)
{
Action jobAction = (() =>
{
try
{
Logger.Info("Job: [{0} ] launched with the following parameters:[{1}]",job,jobParameters);
job.Execute(jobExecution);
Logger.Info("Job: [{0}] completed with the following parameters:[{1}] and the following status: [{2}]",
job,jobParameters,jobExecution.Status);
}
catch (Exception exception)
{
Logger.Info("Job: [{0}] failed unexpectedly and fatally with the following parameters: [{1}]",job,exception);
throw;
}
});
return jobAction;
}