From 8d4ae9d7f9d8ac365953fd5211bb8898a78a5cd4 Mon Sep 17 00:00:00 2001 From: Eric Fontana Date: Tue, 19 Aug 2014 07:31:05 -0400 Subject: [PATCH] Reset WindowsEventListener on Exception --- TimberWinR/Inputs/WindowsEvtInputListener.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/TimberWinR/Inputs/WindowsEvtInputListener.cs b/TimberWinR/Inputs/WindowsEvtInputListener.cs index 4e0c9df..0a03c34 100644 --- a/TimberWinR/Inputs/WindowsEvtInputListener.cs +++ b/TimberWinR/Inputs/WindowsEvtInputListener.cs @@ -91,12 +91,14 @@ namespace TimberWinR.Inputs } // Close the recordset rs.close(); + firstQuery = false; } catch (Exception ex) { - LogManager.GetCurrentClassLogger().Error(ex); - } - firstQuery = false; + LogManager.GetCurrentClassLogger().Error("WindowsEventListener", ex); + firstQuery = true; + oLogQuery = new LogQuery(); + } System.Threading.Thread.Sleep(_pollingIntervalInSeconds * 1000); }