Interface IScheduledJobStatusService
Status service that interacts with the scheduler executing the jubs
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 9.12.2Syntax
public interface IScheduledJobStatusService
Methods
GetExecutionLog(Guid)
List log information for the ScheduledJob.
Declaration
IEnumerable<ScheduledJobLogItem> GetExecutionLog(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ScheduledJobLogItem> |
Remarks
Method returns a maximum of 100 log items
GetNextScheduledJob()
Get the next job up for execution
Declaration
ScheduledJob GetNextScheduledJob()
Returns
Type | Description |
---|---|
ScheduledJob | A ScheduledJob instance if there is a waiting job, otherwise null. |
MarkAsFailed(Guid)
Mark the scheduled job as failed to prevent it from being executed. This flag is only temporary and execution will start again when the application has been restarted.
Declaration
void MarkAsFailed(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The job identifier |
ReportExecutedJob(Guid, Boolean, String)
Report a job as executed with status information of outcome
Declaration
void ReportExecutedJob(Guid id, bool success, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Job id |
System.Boolean | success | If the job executed successfully |
System.String | message | Log message |
TryMarkForExecution(Guid, DateTime, TimeSpan)
Marks a job for execution to prevent others to run job scheduled for a specific time
Declaration
bool TryMarkForExecution(Guid id, DateTime scheduledAt, TimeSpan pingTimeout)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The identity |
System.DateTime | scheduledAt | The expected execution time, will be validated to make sure no one else have takes the job |
System.TimeSpan | pingTimeout | Expect UpdateRunningState(Guid, Boolean) to be called for running jobs withing the timeout specified |
Returns
Type | Description |
---|---|
System.Boolean | True if the job was successfully marked for execution |
Remarks
When the ping timeout has expired and no calls to update running state have been made future jobs will no longer be blocked
UpdateCurrentStatusMessage(Guid, String)
Update current status message for a running job
Declaration
void UpdateCurrentStatusMessage(Guid id, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The job id |
System.String | message | Status message |
UpdateRunningState(Guid, Boolean)
Update running state
Declaration
void UpdateRunningState(Guid id, bool isRunning)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Job id |
System.Boolean | isRunning | If job is running or not |