public void Dispose() { this.jobDetail = null; if (this.quartzScheduler != null) { this.Stop(); if (!this.quartzScheduler.IsShutdown) { this.quartzScheduler.Shutdown(); } this.quartzScheduler = null; for (int i = 0; i < 3; i++) { Thread.Sleep(200); } } if (Schedulers.ContainsKey(this.name)) { Schedulers.Remove(this.name); } this.Trigger = null; if (schedulers != null) { schedulers.Clear(); } this.jobDetail = null; }
public static FeedScheduler GetSecheduler(string baseUrl) { if (!Schedulers.ContainsKey(baseUrl)) { throw new Exception("feed scheduler is no instantiation!"); } return(Schedulers[baseUrl]); }
public async void Start(string baseUrl, FeedNode feedNode) { if (Schedulers.ContainsKey(baseUrl)) { return; } Logger.GetLogger(baseUrl).Info(baseUrl + " feed scheduler starting"); this.baseUrl = baseUrl; this.feedNode = feedNode; Schedulers.Add(baseUrl, this); Logger.GetLogger(baseUrl).Info(baseUrl + " feed scheduler started"); await SyncFeed(); AddExtractJob(); }