mirror of https://github.com/abpframework/abp.git
5 changed files with 75 additions and 8 deletions
@ -0,0 +1,34 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.BackgroundJobs.TickerQ; |
|||
|
|||
public class AbpBackgroundJobsTickerQOptions |
|||
{ |
|||
private readonly Dictionary<Type, AbpBackgroundJobsTimeTickerConfiguration> _jobConfigurations; |
|||
|
|||
public AbpBackgroundJobsTickerQOptions() |
|||
{ |
|||
_jobConfigurations = new Dictionary<Type, AbpBackgroundJobsTimeTickerConfiguration>(); |
|||
} |
|||
|
|||
public void AddJobConfiguration<TJob>(AbpBackgroundJobsTimeTickerConfiguration configuration) |
|||
{ |
|||
AddJobConfiguration(typeof(TJob), configuration); |
|||
} |
|||
|
|||
public void AddJobConfiguration(Type jobType, AbpBackgroundJobsTimeTickerConfiguration configuration) |
|||
{ |
|||
_jobConfigurations[jobType] = configuration; |
|||
} |
|||
|
|||
public AbpBackgroundJobsTimeTickerConfiguration? GetJobConfigurationOrNull<TJob>() |
|||
{ |
|||
return GetJobConfigurationOrNull(typeof(TJob)); |
|||
} |
|||
|
|||
public AbpBackgroundJobsTimeTickerConfiguration? GetJobConfigurationOrNull(Type jobType) |
|||
{ |
|||
return _jobConfigurations.GetValueOrDefault(jobType); |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
namespace Volo.Abp.BackgroundJobs.TickerQ; |
|||
|
|||
public class AbpBackgroundJobsTimeTickerConfiguration |
|||
{ |
|||
public int? Retries { get; set; } |
|||
|
|||
public int[]? RetryIntervals { get; set; } |
|||
} |
|||
Loading…
Reference in new issue