Ejemplo n.º 1
0
 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]);
 }
Ejemplo n.º 2
0
 private bool IsDue(DateTime ct, pollWrapper pw)
 {
     return(pw.NextRunTime < ct && pw.LastRunTime != pw.NextRunTime);
 }