diff --git a/src/Foundatio.Extensions.Hosting/Jobs/JobHostExtensions.cs b/src/Foundatio.Extensions.Hosting/Jobs/JobHostExtensions.cs index 5b7f9b14..ef293686 100644 --- a/src/Foundatio.Extensions.Hosting/Jobs/JobHostExtensions.cs +++ b/src/Foundatio.Extensions.Hosting/Jobs/JobHostExtensions.cs @@ -78,11 +78,11 @@ public static IServiceCollection AddCronJob(this IServiceCollection services, Ac return services.AddCronJob(jobOptionsBuilder.Target); } - public static IServiceCollection AddCronJob(this IServiceCollection services, string name, string cronSchedule, Action configureJobOptions = null) where T : class, IJob + public static IServiceCollection AddCronJob(this IServiceCollection services, string cronSchedule, Action configureJobOptions = null) where T : class, IJob { services.AddTransient(); var jobOptionsBuilder = new ScheduledJobOptionsBuilder(); - jobOptionsBuilder.Name(name).CronSchedule(cronSchedule).JobFactory(sp => sp.GetRequiredService()); + jobOptionsBuilder.Name(typeof(T).FullName).CronSchedule(cronSchedule).JobFactory(sp => sp.GetRequiredService()); configureJobOptions?.Invoke(jobOptionsBuilder); return services.AddCronJob(jobOptionsBuilder.Target); }