Improve Logging and Messages for Email Indexing
This commit is contained in:
parent
8ccb4693da
commit
66407cdf99
@ -159,8 +159,7 @@ Public Class frmStart
|
|||||||
|
|
||||||
Sub Check_Dropped_Files()
|
Sub Check_Dropped_Files()
|
||||||
Try
|
Try
|
||||||
ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
|
ClassDatabase.Execute_non_Query($"DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('{Environment.UserName}')")
|
||||||
Dim oIndex As Integer
|
|
||||||
|
|
||||||
For Each oFiledropString As String In ClassFileDrop.files_dropped
|
For Each oFiledropString As String In ClassFileDrop.files_dropped
|
||||||
If oFiledropString IsNot Nothing Then
|
If oFiledropString IsNot Nothing Then
|
||||||
@ -171,12 +170,11 @@ Public Class frmStart
|
|||||||
|
|
||||||
If ClassIndexFunctions.CheckDuplicateFiles(oFilename, "Manuelle Ablage") Then
|
If ClassIndexFunctions.CheckDuplicateFiles(oFilename, "Manuelle Ablage") Then
|
||||||
ClassFilehandle.Decide_FileHandle(oFilename, oHandleType)
|
ClassFilehandle.Decide_FileHandle(oFilename, oHandleType)
|
||||||
oIndex += 1
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')"
|
Dim sql As String = $"SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('{Environment.UserName}')"
|
||||||
DTACTUAL_FILES = Nothing
|
DTACTUAL_FILES = Nothing
|
||||||
DTACTUAL_FILES = ClassDatabase.Return_Datatable(sql, True)
|
DTACTUAL_FILES = ClassDatabase.Return_Datatable(sql, True)
|
||||||
ABORT_INDEXING = False
|
ABORT_INDEXING = False
|
||||||
@ -191,12 +189,26 @@ Public Class frmStart
|
|||||||
|
|
||||||
If DTACTUAL_FILES.Rows.Count > 1 And oOnlyFilesFromFilesystem = False Then
|
If DTACTUAL_FILES.Rows.Count > 1 And oOnlyFilesFromFilesystem = False Then
|
||||||
frmIndexFileList.ShowDialog()
|
frmIndexFileList.ShowDialog()
|
||||||
|
LOGGER.Debug("Email Indexing Dialog closed, checking for files to be indexed")
|
||||||
|
|
||||||
DTACTUAL_FILES = Nothing
|
DTACTUAL_FILES = Nothing
|
||||||
DTACTUAL_FILES = ClassDatabase.Return_Datatable(sql, True)
|
DTACTUAL_FILES = ClassDatabase.Return_Datatable(sql, True)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If DTACTUAL_FILES.Rows.Count = 0 Then
|
||||||
|
LOGGER.Debug("No files to be indexed, aborting!")
|
||||||
|
|
||||||
|
If USER_LANGUAGE = "de-DE" Then
|
||||||
|
MsgBox("Es wurden keine Dateien für die Indexierung ausgewählt. Der Indexierungsvorgang wird beendet.", MsgBoxStyle.Information, Text)
|
||||||
|
Else
|
||||||
|
MsgBox("You did not select any files for indexing. Indexing will be stopped.", MsgBoxStyle.Information, Text)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
For Each Filerow As DataRow In DTACTUAL_FILES.Rows
|
For Each Filerow As DataRow In DTACTUAL_FILES.Rows
|
||||||
Dim filestring As String = Filerow.Item("FILENAME2WORK")
|
Dim oFileString As String = Filerow.Item("FILENAME2WORK")
|
||||||
|
LOGGER.Info("Processing user file {0}", oFileString)
|
||||||
|
|
||||||
CURRENT_FILENAME = Filerow.Item("FILENAME2WORK")
|
CURRENT_FILENAME = Filerow.Item("FILENAME2WORK")
|
||||||
CURRENT_WORKFILE_GUID = Filerow.Item(0)
|
CURRENT_WORKFILE_GUID = Filerow.Item(0)
|
||||||
CURRENT_WORKFILE = Filerow.Item("FILENAME2WORK")
|
CURRENT_WORKFILE = Filerow.Item("FILENAME2WORK")
|
||||||
@ -207,8 +219,10 @@ Public Class frmStart
|
|||||||
Open_IndexDialog()
|
Open_IndexDialog()
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Show()
|
Show()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
LOGGER.Error(ex)
|
||||||
MsgBox("Unexpected Error in Check_Dropped_Files:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Unexpected Error in Check_Dropped_Files:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
@ -227,8 +241,6 @@ Public Class frmStart
|
|||||||
|
|
||||||
Private Sub frmStart_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
Private Sub frmStart_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||||
Try
|
Try
|
||||||
|
|
||||||
LOGGER.Info("")
|
|
||||||
If START_INCOMPLETE = False Then
|
If START_INCOMPLETE = False Then
|
||||||
Dim Sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND UPPER(MODULE) = UPPER('Global-Indexer')"
|
Dim Sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND UPPER(MODULE) = UPPER('Global-Indexer')"
|
||||||
ClassDatabase.Execute_non_Query(Sql, True)
|
ClassDatabase.Execute_non_Query(Sql, True)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user