Hello,
I'm using a static Timer in my Global.asax to run a method at regular intervals. When the method throws an exception, my application is stopped. I have used an empty catch to prevent exceptions from stopping the application something like below code. Is there a disadvantage to use such an approach?
protected void Application_Start(object sender, EventArgs e)
{
TimerStarter.StartTimer();
}
public class TimerStarter
{
private static System.Threading.Timer threadingTimer;
public static void StartTimer()
{
if (null == threadingTimer)
{
threadingTimer = new System.Threading.Timer(new System.Threading.TimerCallback(CheckData),HttpContext.Current, 0, 50000);
}
}
private static void CheckData(object sender)
...
Go to the complete details ...