tags:

views:

28

answers:

1

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

A: 

You might consider appending the messages to a single email that accumulates (in a log style possibly) messages and then after thresholds are met, sends that single [larger] email to the adminisrtators.

At least then, you're not just dumping potentially important messages, but at the same time you're not sending 1000 emails a minute (just one really large one).

Coding Gorilla