/// <summary> /// 启用任务调度 /// 启动调度时会把任务表中状态为“执行中”的任务加入到任务调度队列中 /// </summary> public static void StartScheduler() { try { DependencyConfig.Register(); using (var timeScope = DependencyConfig.Container.BeginLifetimeScope()) { _jobTaskRepository = timeScope.Resolve <IJobTaskRepository>(); if (TaskManager.scheduler != null) { //获取所有执行中的任务 List <JobTask> listTask = _jobTaskRepository.GetList(); if (listTask != null && listTask.Count > 0) { foreach (JobTask taskUtil in listTask) { try { ScheduleJob(taskUtil); } catch (Exception e) { LogHelper.WriteLog(string.Format("任务“{0}”启动失败!", taskUtil.TaskName), e); } } } LogHelper.WriteLog("任务调度启动成功!"); } } } catch (Exception ex) { LogHelper.WriteLog("任务调度启动失败!", ex); } }
public DeleteJobTaskUseCase(IJobTaskRepository taskRepository, IJobOwnerShipValidator jobOwnerShipValidator, IApplicationErrorFactory applicationErrorFactory) { this.taskRepository = taskRepository; this.jobOwnerShipValidator = jobOwnerShipValidator; this.applicationErrorFactory = applicationErrorFactory; }
public UpdateJobTaskUseCase(IJobTaskRepository taskRepository, IJobOwnerShipValidator jobOwnerShipValidator, IApplicationErrorFactory applicationErrorFactory, IMapper mapper) { this.taskRepository = taskRepository; this.jobOwnerShipValidator = jobOwnerShipValidator; this.applicationErrorFactory = applicationErrorFactory; this.mapper = mapper; }
public FinishJobTaskUseCase( IJobTaskRepository jobTaskRepository, IApplicationErrorFactory applicationErrorFactory, ITaskAssignedValidator taskAssignedValidator) { this.jobTaskRepository = jobTaskRepository; this.applicationErrorFactory = applicationErrorFactory; this.taskAssignedValidator = taskAssignedValidator; }
public UnAssignJobTaskUseCase( IJobTaskRepository jobTaskRepository, IJobOwnerShipValidator jobOwnerShipValidator, IApplicationErrorFactory applicationErrorFactory) { this.jobTaskRepository = jobTaskRepository; this.jobOwnerShipValidator = jobOwnerShipValidator; this.applicationErrorFactory = applicationErrorFactory; }
public GetJobTaskDetailQueryHandler(IJobTaskRepository repo) { _repo = repo; }
public CreateJobTaskCommandHandler(IJobTaskRepository jobTaskRepository) { _jobTaskRepository = jobTaskRepository; }
public RemoveResourcesCommandHandler(IJobTaskRepository repo) { _repo = repo; }
public AssignWorkersCommandHandler(IJobTaskRepository repo) { _repo = repo; }
public AssignResourcesCommandHandler(IJobTaskRepository repo) { _repo = repo; }
public TaskAssignedValidator(IJobTaskRepository jobTaskRepository) { this.jobTaskRepository = jobTaskRepository; }
public DeleteJobTaskCommandHandler(IJobTaskRepository repo) { _repo = repo; }
public RemoveWorkersCommandHandler(IJobTaskRepository repo) { _repo = repo; }
public EditJobTaskCommandHandler(IJobTaskRepository repo) { _repo = repo; }
public GetJobTasksListQueryHandler(IJobTaskRepository repo) { _repo = repo; }