jj; endless errors pt. 2

This commit is contained in:
Jonathan Jenne 2018-06-26 17:08:20 +02:00
parent 65b5ac95e9
commit 531fba3cbc
2 changed files with 52 additions and 47 deletions

View File

@ -216,9 +216,8 @@ Public Class ClassDatabase
Public Shared Sub CatchDatabaseTimeout(ex As SqlException, sql_command As String)
Dim FatalErrors As New List(Of Integer) From {-1, -2, 121}
If DatabaseConnectionTimeout = False And FatalErrors.Contains(ex.Number) Then
If FatalErrors.Contains(ex.Number) Then
DatabaseConnectionTimeout = True
MsgBox($"Database could not be reached. Global Indexer will NOT work without a database!{vbCrLf}{vbCrLf}Please check your connection and restart.", MsgBoxStyle.Critical, "Critical Error")
ClassLogger.Add("Network timeout error in Return_Datatable: " & ex.Message, True)
ClassLogger.Add("#SQL: " & sql_command, False)

View File

@ -671,10 +671,13 @@ Public Class frmStart
Private Sub TimerFolderWatch_Tick(sender As Object, e As EventArgs) Handles TimerFolderWatch.Tick
If ClassDatabase.DatabaseConnectionTimeout = True Then
TimerFolderWatch.Enabled = False
ClassLogger.Add(">> Timer stopped because of database timeout error!", False)
Exit Sub
End If
Dim result = MsgBox($"Database could not be reached. Global Indexer will NOT work without a database!{vbCrLf}{vbCrLf}Please check your connection.{vbCrLf}The Application will exit now.", MsgBoxStyle.Critical, "Critical Error")
If result = MsgBoxResult.Ok Then
Application.ExitThread()
End If
Else
Try
If FW_started = True Or FWSCAN_started = True Then
'Prüfen ob alle Files abgearbeitet wurden
@ -719,6 +722,9 @@ Public Class frmStart
Catch ex As Exception
MsgBox("Error in Work FolderWatch-File:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End If
End Sub
Private Sub TimerClose3Minutes_Tick(sender As Object, e As EventArgs) Handles TimerClose3Minutes.Tick
If LICENSE_EXPIRED = True Or LICENSE_COUNT < UserLoggedin Then