2024-11-15 16:45:01 +08:00
|
|
|
|
using Volo.Abp.BackgroundWorkers.Hangfire;
|
|
|
|
|
|
using Volo.Abp.DependencyInjection;
|
|
|
|
|
|
|
2024-11-15 18:17:53 +08:00
|
|
|
|
namespace Yi.Framework.BackgroundWorkers.Hangfire;
|
2024-11-15 16:45:01 +08:00
|
|
|
|
|
|
|
|
|
|
public class YiHangfireConventionalRegistrar : DefaultConventionalRegistrar
|
|
|
|
|
|
{
|
|
|
|
|
|
protected override bool IsConventionalRegistrationDisabled(Type type)
|
|
|
|
|
|
{
|
|
|
|
|
|
return !typeof(IHangfireBackgroundWorker).IsAssignableFrom(type) || base.IsConventionalRegistrationDisabled(type);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override List<Type> GetExposedServiceTypes(Type type)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new List<Type>()
|
|
|
|
|
|
{
|
|
|
|
|
|
typeof(IHangfireBackgroundWorker)
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|