Hi all I'm making a system which is essentially a scheduled task system. I have included functionality to email the administrators whenever there's an error, but there needs to be some functionality to not overload the admins emailbox if there is a catastrophic global failure and every job fails.
So far I've allowed the admin to enter 2 settings - 'threshold' and 'batch time (in minutes)'. Basically, the threshold is the number of errors that takes place in the 'batch time'before mailing is stopped and a batch mail is sent, and after that all error mailing is stopped until the administrator disables a flag.
For example, if threshold is 10 and the time is 30, then after 1 error, it should start adding up the errors until 20 minutes is over , when the counter will be reset, or the number of errors is reached which then enables a flag and disables all mailing.
Is that the most efficient way? I'm trying to wrap my head around how I'd do it using my method, but I'm open to ideas.
Thanks