comparison ServerMonitor/Objects/Schedule.cs @ 39:7645122aa7a9

Get it working under Mono
author Brad Greco <brad@bgreco.net>
date Tue, 09 Jun 2020 20:59:00 -0400
parents 2342e9459444
children
comparison
equal deleted inserted replaced
38:8ab98a803d39 39:7645122aa7a9
71 /// <remarks> 71 /// <remarks>
72 /// The next execution time of a check cannot necessarily be determined by taking the 72 /// The next execution time of a check cannot necessarily be determined by taking the
73 /// last execution time and adding the configured number of time units. The computer might 73 /// last execution time and adding the configured number of time units. The computer might
74 /// have been asleep or the program might have not been running, so the next date might 74 /// have been asleep or the program might have not been running, so the next date might
75 /// be in the past. 75 /// be in the past.
76 /// 76 ///
77 /// To best follow the schedule, we take the last execution time and fast-forward time 77 /// To best follow the schedule, we take the last execution time and fast-forward time
78 /// by adding the configured time interval until we get a resulting time that is in the future. 78 /// by adding the configured time interval until we get a resulting time that is in the future.
79 /// For example, suppose a check is scheduled to run every 5 minutes starting at 7:00. 79 /// For example, suppose a check is scheduled to run every 5 minutes starting at 7:00.
80 /// The check last ran at 7:40, and the computer was suspended shortly thereafter and resumed 80 /// The check last ran at 7:40, and the computer was suspended shortly thereafter and resumed
81 /// at 8:28. The next execution time is determined by adding 5 minutes to 7:40 until we obtain 81 /// at 8:28. The next execution time is determined by adding 5 minutes to 7:40 until we obtain
137 return string.Format("Every {0} {1}", Frequency, Units.ToString().ToLower() + (Frequency == 1 ? "" : "s")); 137 return string.Format("Every {0} {1}", Frequency, Units.ToString().ToLower() + (Frequency == 1 ? "" : "s"));
138 } 138 }
139 } 139 }
140 140
141 /// <summary>Units of time that a check can be scheduled to run in intervals of.</summary> 141 /// <summary>Units of time that a check can be scheduled to run in intervals of.</summary>
142 public enum FrequencyUnits { Second, Minute, Hour, Day } 142 public enum FrequencyUnits { Second = 0, Minute = 1, Hour = 2, Day = 3 }
143 } 143 }