public UpdateJob ( string id, Status status, string outcome = null, string scriptName = null ) : void | ||
id | string | |
status | Status | |
outcome | string | |
scriptName | string | |
Résultat | void |
public void OnPerforming(PerformingContext filterContext) { var jobServices = new JobServices(); var scriptName = filterContext.BackgroundJob.Job.Args[0].ToString(); // TODO: test var scriptName = filterContext.BackgroundJob.Job.Method.Name; jobServices.UpdateJob(filterContext.BackgroundJob.Id, Status.Running, null, scriptName); }
public void OnStateElection(ElectStateContext context) { var jobServices = new JobServices(); if (context.CandidateState is FailedState failedState) { jobServices.UpdateJob(context.BackgroundJob.Id, Status.Failed, failedState.Exception.Message); } }
public void OnStateElection(ElectStateContext context) { var jobService = new JobServices(); var failedState = context.CandidateState as FailedState; if (failedState != null) { jobService.UpdateJob(context.BackgroundJob.Id, Status.Failed, failedState.Exception.Message); } }
public void OnStateElection(ElectStateContext context) { var jobService = new JobServices(); var failedState = context.CandidateState as FailedState; if (failedState != null) { jobService.UpdateJob(context.BackgroundJob.Id, Status.Failed, failedState.Exception.Message); } }
public void OnPerformed(PerformedContext filterContext) { var jobServices = new JobServices(); jobServices.UpdateJob(filterContext.BackgroundJob.Id, Status.Completed); }
public void OnPerforming(PerformingContext filterContext) { var jobService = new JobServices(); var scriptName = filterContext.BackgroundJob.Job.Args[0].ToString(); jobService.UpdateJob(filterContext.BackgroundJob.Id, Status.Running, null, scriptName); }
public void OnPerformed(PerformedContext filterContext) { var jobService = new JobServices(); jobService.UpdateJob(filterContext.BackgroundJob.Id, Status.Completed); }