public async Task ResumeAll(ScheduleActionGroup group) { if (_scheduleStatus == 2) { await _scheduler.ResumeAll(); _scheduleStatus = 1; } }
public async Task Shutdown(ScheduleActionGroup group) { if (_scheduleStatus == 1) { foreach (var item in _actions) { await MainJob.Shutdown(item.Name); } await _scheduler.Shutdown(); _scheduleStatus = 0; } }
public async Task Pause(ScheduleActionGroup group) { if (_scheduleStatus == 1) { foreach (var item in _actions) { await MainJob.Pause(item.Name); } await _scheduler.PauseAll(); _scheduleStatus = 2; } }
public async Task Start(ScheduleActionGroup group) { if (_scheduleStatus == 0) { var props = new NameValueCollection(); props["quartz.serializer.type"] = "binary"; StdSchedulerFactory factory = new StdSchedulerFactory(props); _scheduler = await factory.GetScheduler(); MainJob.ScheduleActionRepository = _scheduleActionRepositoryCacheProxy; MainJob.ScheduleActionInitGeneratorServiceFactories = ScheduleActionInitGeneratorServiceFactories; MainJob.ErrorCategory = _errorCategory; MainJob.InformationCategory = _informationCategory; _actions = new List <ScheduleAction>(); await GetAllAction(group, 1, async (action) => { _actions.Add(action); IJobDetail job = JobBuilder.Create <MainJob>() .WithIdentity(action.Name, group.Name) .UsingJobData("InitType", group.ExecuteActionInitType) .UsingJobData("InitConfiguration", group.ExecuteActionInitConfiguration) .UsingJobData("ActionName", action.Name) .UsingJobData("GroupName", group.Name) .Build(); ITrigger trigger = TriggerBuilder.Create() .WithIdentity(action.Name, group.Name) .StartNow() .WithCronSchedule(action.TriggerCondition) .Build(); await _scheduler.ScheduleJob(job, trigger); }); await _scheduler.Start(); _scheduleStatus = 1; } }
public async Task Update(ScheduleActionGroup group) { await _scheduleActionGroupStore.Update(group); }
public Task RemoveAction(ScheduleActionGroup group, Guid actionId) { throw new NotImplementedException(); }
public async Task <QueryResult <ScheduleAction> > GetAction(ScheduleActionGroup group, int page, int pageSize) { return(await _scheduleActionStore.QueryByPageGroup(group.ID, page, pageSize)); }
public async Task GetAllAction(ScheduleActionGroup group, int status, Func <ScheduleAction, Task> callback) { await _scheduleActionStore.QueryAllAction(group.ID, status, callback); }
public async Task Delete(ScheduleActionGroup group) { await _scheduleActionStore.Delete(group.ID); }
public async Task AddAction(ScheduleActionGroup group, Guid actionId) { await _scheduleActionStore.AddActionGroupRelation(actionId, group.ID); }
public async Task Add(ScheduleActionGroup group) { await _scheduleActionGroupStore.Add(group); }