private pollWrapper EnsureWrapped(PollingSchedule item) { if (!pollingControl.ContainsKey(item.Url)) { var pw = new pollWrapper { Schedule = CrontabSchedule.Parse(item.Schedule) //, //LastRunTime = DateTime.MinValue, //NextRunTime = DateTime.MinValue }; pw.NextRunTime = pw.Schedule.GetNextOccurrence(DateTime.Now); pollingControl.Add(item.Url, pw); } return(pollingControl[item.Url]); }
private bool IsDue(DateTime ct, pollWrapper pw) { return(pw.NextRunTime < ct && pw.LastRunTime != pw.NextRunTime); }