public async Task Start(CancellationToken cancellationToken = default(CancellationToken)) { _store = _scheduler.Context.GetExecutionHistoryStore(); if (_store == null) { if (StoreType != null) { _store = (IExecutionHistoryStore)Activator.CreateInstance(StoreType); } if (_store == null) { throw new Exception(nameof(StoreType) + " is not set."); } _scheduler.Context.SetExecutionHistoryStore(_store); } //_store.SchedulerName = _scheduler.SchedulerName; //await _store.Purge(); await Task.CompletedTask; }
public async Task Start(CancellationToken cancellationToken = default) { _store = _scheduler.Context.GetExecutionHistoryStore(); if (_store == null) { if (StoreType != null) { _store = (IExecutionHistoryStore)Activator.CreateInstance(StoreType); } if (_store == null) { throw new Exception(nameof(StoreType) + " is not set."); } _scheduler.Context.SetExecutionHistoryStore(_store); } _store.SchedulerName = _scheduler.SchedulerName; _store.DataPath = DataPath; _store.Initialize(); await Task.FromResult(0); }
public Task Start(CancellationToken cancellationToken = default(CancellationToken)) { _store = _scheduler.Context.GetExecutionHistoryStore(); if (_store == null) { _store = CreateExecutionHistoryStore(); _scheduler.Context.SetExecutionHistoryStore(_store); } _store.SchedulerName = _scheduler.SchedulerName; return(_store.Purge()); }
public async Task <AjaxResult <PagedResultDto <ExecutionHistoryEntry> > > SchedulerHistory(string schedulerName, string searchText, int pageSize, int pageNumber, string sortName = "FIRED_TIME", string sortOrder = "desc") { var result = new AjaxResult <PagedResultDto <ExecutionHistoryEntry> >(); IExecutionHistoryStore _store = _scheduler.Context.GetExecutionHistoryStore(); if (_store == null) { _logger.LogError("Error while retrieving history entries"); result.Success = false; result.Content = "历史记录插件尚未启用"; } else { result.Result = await _store.GetPageJobHistoryEntries(schedulerName, pageNumber, pageSize, sortName + " " + sortOrder).ConfigureAwait(false); } return(result); }
/// <summary> /// Called when the associated <see cref="IScheduler" /> is started, in order /// to let the plug-in know it can now make calls into the scheduler if it /// needs to. /// </summary> public virtual async Task Start(CancellationToken cancellationToken = default) { // do nothing... _store = _scheduler.Context.GetExecutionHistoryStore(); if (_store == null) { if (StoreType != null) { _store = (IExecutionHistoryStore)Activator.CreateInstance(StoreType, new string[] { DataSource, DriverDelegateType, TablePrefix, Provider }); } if (_store == null) { throw new Exception(nameof(StoreType) + " is not set."); } _scheduler.Context.SetExecutionHistoryStore(_store); } //_store.SchedulerName = _scheduler.SchedulerName; await Task.CompletedTask; }
public ExecutionsController(IExecutionHistoryStore HistStore, ISchedulerPlugin executionHistoryPlugin) : base(HistStore, executionHistoryPlugin) { }
public ExecutionHistoryPlugin(IExecutionHistoryStore store) { _store = store; }
public static void SetExecutionHistoryStore(this SchedulerContext context, IExecutionHistoryStore store) { context.Put(typeof(IExecutionHistoryStore).FullName, store); }