|  | @@ -57,11 +57,16 @@ public static class TaskSchedulerServiceExtensions
 | 
											
												
													
														|  |              freeSql.CodeFirst.SyncStructure<TaskLog>();
 |  |              freeSql.CodeFirst.SyncStructure<TaskLog>();
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        if(options.TaskHandler != null)
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (options.TaskHandler != null && options.CustomTaskHandler == null)
 | 
											
												
													
														|  |          {
 |  |          {
 | 
											
												
													
														|  |              //开启任务
 |  |              //开启任务
 | 
											
												
													
														|  |              var scheduler = new Scheduler(options.TaskHandler);
 |  |              var scheduler = new Scheduler(options.TaskHandler);
 | 
											
												
													
														|  |              services.AddSingleton(scheduler);
 |  |              services.AddSingleton(scheduler);
 | 
											
												
													
														|  | 
 |  | +        } else if  (options.TaskHandler != null && options.CustomTaskHandler != null)
 | 
											
												
													
														|  | 
 |  | +        {
 | 
											
												
													
														|  | 
 |  | +            //开启自定义任务
 | 
											
												
													
														|  | 
 |  | +            var scheduler = new Scheduler(options.TaskHandler, options.CustomTaskHandler);
 | 
											
												
													
														|  | 
 |  | +            services.AddSingleton(scheduler);
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 |