|
|
|
@ -9,13 +9,6 @@ namespace Volo.Abp.BackgroundJobs
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IBackgroundJobStore
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a BackgroundJobInfo based on the given jobId.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="jobId">The Job Unique Identifier.</param>
|
|
|
|
|
/// <returns>The BackgroundJobInfo object.</returns>
|
|
|
|
|
BackgroundJobInfo Find(Guid jobId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a BackgroundJobInfo based on the given jobId.
|
|
|
|
|
/// </summary>
|
|
|
|
@ -23,27 +16,12 @@ namespace Volo.Abp.BackgroundJobs
|
|
|
|
|
/// <returns>The BackgroundJobInfo object.</returns>
|
|
|
|
|
Task<BackgroundJobInfo> FindAsync(Guid jobId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Inserts a background job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="jobInfo">Job information.</param>
|
|
|
|
|
void Insert(BackgroundJobInfo jobInfo);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Inserts a background job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="jobInfo">Job information.</param>
|
|
|
|
|
Task InsertAsync(BackgroundJobInfo jobInfo);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets waiting jobs. It should get jobs based on these:
|
|
|
|
|
/// Conditions: !IsAbandoned And NextTryTime <= Clock.Now.
|
|
|
|
|
/// Order by: Priority DESC, TryCount ASC, NextTryTime ASC.
|
|
|
|
|
/// Maximum result: <paramref name="maxResultCount"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="maxResultCount">Maximum result count.</param>
|
|
|
|
|
List<BackgroundJobInfo> GetWaitingJobs(int maxResultCount);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets waiting jobs. It should get jobs based on these:
|
|
|
|
|
/// Conditions: !IsAbandoned And NextTryTime <= Clock.Now.
|
|
|
|
@ -53,24 +31,12 @@ namespace Volo.Abp.BackgroundJobs
|
|
|
|
|
/// <param name="maxResultCount">Maximum result count.</param>
|
|
|
|
|
Task<List<BackgroundJobInfo>> GetWaitingJobsAsync(int maxResultCount);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes a job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="jobId">The Job Unique Identifier.</param>
|
|
|
|
|
void Delete(Guid jobId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes a job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="jobId">The Job Unique Identifier.</param>
|
|
|
|
|
Task DeleteAsync(Guid jobId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates a job.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="jobInfo">Job information.</param>
|
|
|
|
|
void Update(BackgroundJobInfo jobInfo);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates a job.
|
|
|
|
|
/// </summary>
|
|
|
|
|