From daa89b0535bf6d3811c6a08d66c476d712330d9e Mon Sep 17 00:00:00 2001 From: SchreiberM Date: Tue, 11 Jun 2024 16:23:04 +0200 Subject: [PATCH] MS Debug Folderwatch --- Global_Indexer/ClassFileHandler.vb | 1 + Global_Indexer/ClassInit.vb | 3 +-- Global_Indexer/ModuleRuntime.vb | 1 + Global_Indexer/My Project/AssemblyInfo.vb | 4 ++-- Global_Indexer/frmStart.vb | 14 ++++++++++---- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Global_Indexer/ClassFileHandler.vb b/Global_Indexer/ClassFileHandler.vb index 1711f9d..9cff488 100644 --- a/Global_Indexer/ClassFileHandler.vb +++ b/Global_Indexer/ClassFileHandler.vb @@ -57,6 +57,7 @@ Public Class ClassFileHandler Public Function Decide_FileHandle(pFilepath As String, pHandletype As String) As Boolean Try + Logger.Info($"Decide_FileHandle - pFilepath: {pFilepath} - pHandletype: {pHandletype}") ''TODO: Before doing anything, clean the filename 'Dim oFilename = IO.Path.GetFileName(pFilepath) 'Dim oCleanFileName = Utils.RemoveInvalidCharacters(oFilename) diff --git a/Global_Indexer/ClassInit.vb b/Global_Indexer/ClassInit.vb index 058ee88..8b98f65 100644 --- a/Global_Indexer/ClassInit.vb +++ b/Global_Indexer/ClassInit.vb @@ -221,8 +221,7 @@ Public Class ClassInit oHandleType = "|FW_SIMPLEINDEXER|" End If 'Die Datei übergeben - LOGGER.Info(">> OnCreated-File:" & e.FullPath) - + LOGGER.Info(">> Adding file from Hotfolder (OnCreated):" & e.FullPath) If ClassIndexFunctions.CheckDuplicateFiles(Form, e.FullPath, "FolderWatch/Scan") Then FILE_HANDLER.Decide_FileHandle(e.FullPath, oHandleType) End If diff --git a/Global_Indexer/ModuleRuntime.vb b/Global_Indexer/ModuleRuntime.vb index 13702c7..5e2613b 100644 --- a/Global_Indexer/ModuleRuntime.vb +++ b/Global_Indexer/ModuleRuntime.vb @@ -29,4 +29,5 @@ Module ModuleRuntime Public Property DATABASE_ECM As MSSQLServer Public Property DATABASE_IDB As MSSQLServer + Public Property DebugDisplay As Boolean = False End Module diff --git a/Global_Indexer/My Project/AssemblyInfo.vb b/Global_Indexer/My Project/AssemblyInfo.vb index 8901577..0c8957d 100644 --- a/Global_Indexer/My Project/AssemblyInfo.vb +++ b/Global_Indexer/My Project/AssemblyInfo.vb @@ -14,7 +14,7 @@ Imports System.Runtime.InteropServices - + @@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + \ No newline at end of file diff --git a/Global_Indexer/frmStart.vb b/Global_Indexer/frmStart.vb index 6c9719d..644c2cc 100644 --- a/Global_Indexer/frmStart.vb +++ b/Global_Indexer/frmStart.vb @@ -509,13 +509,19 @@ Public Class frmStart If FW_started = True Or CONFIG.Config.FolderWatchScanStarted = True Then 'Prüfen ob alle Files abgearbeitet wurden - Dim sql = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND HANDLE_TYPE like '%|FW%' AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')" - DTACTUAL_FILES = DATABASE_ECM.GetDatatable(sql) + Dim oSql = $"SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND HANDLE_TYPE like '%|FW%' AND USER@WORK = '{Environment.UserName}'" + DTACTUAL_FILES = DATABASE_ECM.GetDatatable(oSql) If DTACTUAL_FILES.Rows.Count > 0 Then ABORT_INDEXING = False - ' Dim fil As String Me.TimerFolderWatch.Stop() + If LOGCONFIG.Debug And DebugDisplay = False Then + Clipboard.Clear() + Clipboard.SetText(oSql, TextDataFormat.Text) + DebugDisplay = True + MsgBox("DEBUG - Check TBGI_FILES_USER if necessary. Command copied to Clipboard") + End If + For Each row As DataRow In DTACTUAL_FILES.Rows Dim FILEGUID = row.Item("GUID") If ABORT_INDEXING = True Then @@ -534,7 +540,7 @@ Public Class frmStart Open_IndexDialog() Else - LOGGER.Info(">> File not existing - Row will be deleted!") + LOGGER.Info($">> File [{FileForWork}] not existing - row from TBGI_FILES_USER will be deleted!") Dim del = String.Format("DELETE FROM TBGI_FILES_USER WHERE GUID = {0}", FILEGUID) DATABASE_ECM.ExecuteNonQuery(del) End If