diff --git a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/InMemoryBackgroundJobStore.cs b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/InMemoryBackgroundJobStore.cs index 2e3e8879ec..1dc6d7c700 100644 --- a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/InMemoryBackgroundJobStore.cs +++ b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/InMemoryBackgroundJobStore.cs @@ -23,19 +23,19 @@ namespace Volo.Abp.BackgroundJobs _jobs = new ConcurrentDictionary(); } - public Task FindAsync(Guid jobId) + public virtual Task FindAsync(Guid jobId) { return Task.FromResult(_jobs.GetOrDefault(jobId)); } - public Task InsertAsync(BackgroundJobInfo jobInfo) + public virtual Task InsertAsync(BackgroundJobInfo jobInfo) { _jobs[jobInfo.Id] = jobInfo; return Task.FromResult(0); } - public Task> GetWaitingJobsAsync(int maxResultCount) + public virtual Task> GetWaitingJobsAsync(int maxResultCount) { var waitingJobs = _jobs.Values .Where(t => !t.IsAbandoned && t.NextTryTime <= Clock.Now) @@ -48,14 +48,14 @@ namespace Volo.Abp.BackgroundJobs return Task.FromResult(waitingJobs); } - public Task DeleteAsync(Guid jobId) + public virtual Task DeleteAsync(Guid jobId) { _jobs.TryRemove(jobId, out _); return Task.FromResult(0); } - public Task UpdateAsync(BackgroundJobInfo jobInfo) + public virtual Task UpdateAsync(BackgroundJobInfo jobInfo) { if (jobInfo.IsAbandoned) { diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs index 5277b5f4f4..fed3718f85 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs @@ -19,33 +19,33 @@ namespace Volo.Abp.BackgroundJobs BackgroundJobRepository = backgroundJobRepository; } - public async Task FindAsync(Guid jobId) + public virtual async Task FindAsync(Guid jobId) { return ObjectMapper.Map( await BackgroundJobRepository.FindAsync(jobId) ); } - public async Task InsertAsync(BackgroundJobInfo jobInfo) + public virtual async Task InsertAsync(BackgroundJobInfo jobInfo) { await BackgroundJobRepository.InsertAsync( ObjectMapper.Map(jobInfo) ); } - public async Task> GetWaitingJobsAsync(int maxResultCount) + public virtual async Task> GetWaitingJobsAsync(int maxResultCount) { return ObjectMapper.Map, List>( await BackgroundJobRepository.GetWaitingListAsync(maxResultCount) ); } - public async Task DeleteAsync(Guid jobId) + public virtual async Task DeleteAsync(Guid jobId) { await BackgroundJobRepository.DeleteAsync(jobId); } - public async Task UpdateAsync(BackgroundJobInfo jobInfo) + public virtual async Task UpdateAsync(BackgroundJobInfo jobInfo) { await BackgroundJobRepository.UpdateAsync( ObjectMapper.Map(jobInfo)