Jobs/GraphQL: Actually insert the status value

This commit is contained in:
Jonathan Jenne 2022-11-25 11:28:35 +01:00
parent 1d04027c5f
commit 55fc875d3a

View File

@ -223,24 +223,24 @@ Public Class GraphQLJob
Try Try
oResultList = oObj.SelectToken(QueryData.MappingBasePath, errorWhenNoMatch:=True) oResultList = oObj.SelectToken(QueryData.MappingBasePath, errorWhenNoMatch:=True)
Catch ex As Exception Catch ex As Exception
_Logger.Warn("HandleResponse: Could not find BasePath: [{0}] for query [{1}]", QueryData.MappingBasePath, QueryData.Name) _Logger.Warn("WriteNewQueryData: Could not find BasePath: [{0}] for query [{1}]", QueryData.MappingBasePath, QueryData.Name)
_Logger.Error(ex) _Logger.Error(ex)
Return Nothing Return Nothing
End Try End Try
If oResultList Is Nothing Then If oResultList Is Nothing Then
_Logger.Warn("HandleResponse: Could not find BasePath: [{0}] for query [{1}]", QueryData.MappingBasePath, QueryData.Name) _Logger.Warn("WriteNewQueryData: Could not find BasePath: [{0}] for query [{1}]", QueryData.MappingBasePath, QueryData.Name)
Return Nothing Return Nothing
End If End If
_Logger.Info("HandleResponse: Processing Queue [{0}] with [{1}] Items", QueryData.Name, oResultList.Count) _Logger.Info("WriteNewQueryData: Processing Queue [{0}] with [{1}] Items", QueryData.Name, oResultList.Count)
For Each oResultItem As JToken In oResultList For Each oResultItem As JToken In oResultList
Try Try
' ADDED_WHO, ADDED_QUERY_ID are system fields which are used to correctly fill ' ADDED_WHO, ADDED_QUERY_ID are system fields which are used to correctly fill
' and delete rows in the destination table without touching rows from other queries ' and delete rows in the destination table without touching rows from other queries
Dim oKeys As New List(Of String) From {"ADDED_WHO", "ADDED_QUERY_ID"} Dim oKeys As New List(Of String) From {"ADDED_WHO", "ADDED_QUERY_ID", "STATUS"}
Dim oValues As New List(Of String) From {JOB_NAME, QueryData.Id} Dim oValues As New List(Of String) From {JOB_NAME, QueryData.Id, "1"}
For Each oMapping In QueryData.MappingFields For Each oMapping In QueryData.MappingFields
Dim oValue As String = String.Empty Dim oValue As String = String.Empty
@ -251,7 +251,7 @@ Public Class GraphQLJob
Dim oToken = oResultItem.SelectToken(oMapping.SourcePath) Dim oToken = oResultItem.SelectToken(oMapping.SourcePath)
If oToken Is Nothing Then If oToken Is Nothing Then
_Logger.Warn("HandleResponse: Could not find value at SourcePath: {0}", oMapping.SourcePath) _Logger.Warn("WriteNewQueryData: Could not find value at SourcePath: {0}", oMapping.SourcePath)
oValue = String.Empty oValue = String.Empty
Else Else
oValue = oToken.ToString oValue = oToken.ToString