Ms
This commit is contained in:
@@ -37,7 +37,7 @@ Module Module1
|
||||
'Dim oArguments As String() = Environment.GetCommandLineArgs()
|
||||
If ParseArgs(args) = True Then
|
||||
System.Console.WriteLine($"Parsed all arguments!")
|
||||
If StreamIndexFile() = True Then
|
||||
If StreamORIndexFile() = True Then
|
||||
oErrorImport = False
|
||||
oReturnResult = 1
|
||||
Else
|
||||
@@ -169,17 +169,28 @@ Module Module1
|
||||
oArg = oArg.Replace("""", "")
|
||||
If oArg.StartsWith("-Source@") Then
|
||||
oSourceFile = oArg.Replace("-Source@", "")
|
||||
If IsNumeric(oSourceFile) Then
|
||||
LOGGER.Info($"SourceFile seems to be a DocID [{oSourceFile}]")
|
||||
Dim oSQL = $"SELECT [dbo].[FNDD_GET_WINDREAM_FILE_PATH] ({oSourceFile})"
|
||||
oSourceFile = _database.GetScalarValue(oSQL)
|
||||
End If
|
||||
If System.IO.File.Exists(oSourceFile) = False Then
|
||||
LOGGER.Warn($"Parser@Sourcefile - File [{oSourceFile}] is not existing!")
|
||||
oErrorMessage &= vbNewLine & $"Parser@Sourcefile - File [{oSourceFile}] is not existing!"
|
||||
oErrorParse = True
|
||||
Return False
|
||||
End If
|
||||
|
||||
ElseIf oArg.StartsWith("-Mode@") Then
|
||||
oMode = oArg.Replace("-Mode@", "").ToUpper
|
||||
|
||||
ElseIf oArg.StartsWith("-Target@") Then
|
||||
oTargetPath = oArg.Replace("-Target@", "")
|
||||
If IsNumeric(oTargetPath) Then
|
||||
LOGGER.Info($"Target seems to be a DocID [{oTargetPath}]")
|
||||
Dim oSQL = $"SELECT [dbo].[FNDD_GET_WINDREAM_FILE_PATH] ({oTargetPath})"
|
||||
oSourceFile = _database.GetScalarValue(oSQL)
|
||||
End If
|
||||
Dim oWMFolder = System.IO.Path.GetDirectoryName(oTargetPath)
|
||||
Dim oWindowsPath = oTargetPath
|
||||
oExtension = Path.GetExtension(oWindowsPath)
|
||||
@@ -234,14 +245,16 @@ Module Module1
|
||||
oIndexArr = oIndexparts
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Warn("Error in ParseArgs:" & vbNewLine & ex.Message)
|
||||
oErrorMessage &= vbNewLine & "Error in ParseArgs:" & vbNewLine & ex.Message
|
||||
oErrorParse = True
|
||||
System.Console.WriteLine($"Error in ParseArgs - {Now.ToString}")
|
||||
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Public Function StreamIndexFile()
|
||||
Public Function StreamORIndexFile()
|
||||
Try
|
||||
Dim oResult As Boolean = False
|
||||
If oMode = "IMPV" Then
|
||||
@@ -259,7 +272,10 @@ Module Module1
|
||||
|
||||
|
||||
If oResult = True Then
|
||||
LOGGER.Info($"File successfully streamed to windream [{oTargetPath}]! Now indexing...")
|
||||
If oMode <> "NI" Then
|
||||
LOGGER.Info($"File successfully streamed to windream [{oTargetPath}]! Now indexing...")
|
||||
End If
|
||||
|
||||
For Each oIndex2 As String In oIndexArr
|
||||
Dim oIndexInfo() = oIndex2.Split("={")
|
||||
Dim oIndexName = oIndexInfo(0)
|
||||
@@ -302,13 +318,14 @@ Module Module1
|
||||
Loop
|
||||
Next
|
||||
If oResult = True Then
|
||||
LOGGER.Info("Import finished!")
|
||||
LOGGER.Info("## All Tasks finished ##")
|
||||
oErrorImport = False
|
||||
End If
|
||||
End If
|
||||
Return oResult
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn($"Error while indexing: {ex.Message}")
|
||||
LOGGER.Warn($"Unexpected Error in StreamORIndexFile: {ex.Message}")
|
||||
LOGGER.Error(ex)
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user