jj: fix endless errors on db timeout \o/

This commit is contained in:
Jonathan Jenne
2018-06-26 14:41:58 +02:00
parent 7b445c8d36
commit 65b5ac95e9
3 changed files with 95 additions and 34 deletions

View File

@@ -151,6 +151,11 @@ Public Class ClassFolderWatcher
End If
End Function
Private Shared Sub OnCreated(source As Object, e As FileSystemEventArgs)
If ClassDatabase.DatabaseConnectionTimeout = True Then
ClassLogger.Add(">> File handling aborted because of database timeout error!", False)
Exit Sub
End If
Try
For Each row As DataRow In DTEXCLUDE_FILES.Rows
Dim content As String = row.Item(0).ToString.ToLower
@@ -158,7 +163,7 @@ Public Class ClassFolderWatcher
Exit Sub
End If
Next
Dim handleType As String
If e.FullPath.ToLower.EndsWith(".msg") Then
handleType = "|FW_OUTLOOK_MESSAGE|"
@@ -172,11 +177,11 @@ Public Class ClassFolderWatcher
Else
ClassLogger.Add(">> Folderwatcher: File already exists:" & e.FullPath, False)
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in folder_watch_Created")
End Try
End Sub
End Class