Fixed a bug where the ProcessProcedureQueue service would write an invalid record to the PROC_QUEUE2 table when failing to read a record.
This commit is contained in:
@ -182,27 +182,27 @@ Service ProcessProcedureQueue()
|
|||||||
Loop
|
Loop
|
||||||
ReadNext RequestKeyID else EOF = True$
|
ReadNext RequestKeyID else EOF = True$
|
||||||
Until EOF
|
Until EOF
|
||||||
SendRequest = True$
|
|
||||||
Read RequestRec from hProcQueue, RequestKeyID then
|
Read RequestRec from hProcQueue, RequestKeyID then
|
||||||
InQueue = RequestRec<PROC_QUEUE.IN_QUEUE$>
|
SendRequest = True$
|
||||||
|
InQueue = RequestRec<PROC_QUEUE.IN_QUEUE$>
|
||||||
If InQueue then
|
If InQueue then
|
||||||
QueuedDtm = RequestRec<PROC_QUEUE.QUEUED_DTM$>
|
QueuedDtm = RequestRec<PROC_QUEUE.QUEUED_DTM$>
|
||||||
If QueuedDtm GT SRP_Datetime('AddMinutes', Datetime(), -10) then
|
If QueuedDtm GT SRP_Datetime('AddMinutes', Datetime(), -10) then
|
||||||
SendRequest = False$
|
SendRequest = False$
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
If SendRequest then
|
||||||
If SendRequest then
|
TcpClientHandle = 0
|
||||||
TcpClientHandle = 0
|
If SRP_TcpClient(TcpClientHandle, 'CONNECT', ServerIP, ServerPort) then
|
||||||
If SRP_TcpClient(TcpClientHandle, 'CONNECT', ServerIP, ServerPort) then
|
RequestRec<PROC_QUEUE.IN_QUEUE$> = True$
|
||||||
RequestRec<PROC_QUEUE.IN_QUEUE$> = True$
|
RequestRec<PROC_QUEUE.QUEUED_DTM$> = Datetime()
|
||||||
RequestRec<PROC_QUEUE.QUEUED_DTM$> = Datetime()
|
Write RequestRec on hProcQueue, RequestKeyID then
|
||||||
Write RequestRec on hProcQueue, RequestKeyID then
|
Command = 'RUN SERVICE_SERVICES "ProcessRequest", ':Quote(RequestKeyID)
|
||||||
Command = 'RUN SERVICE_SERVICES "ProcessRequest", ':Quote(RequestKeyID)
|
SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command)
|
||||||
SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command)
|
end
|
||||||
end
|
SRP_TcpClient(TcpClientHandle, 'CLOSE_SES')
|
||||||
SRP_TcpClient(TcpClientHandle, 'CLOSE_SES')
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Repeat
|
Repeat
|
||||||
end
|
end
|
||||||
@ -474,4 +474,3 @@ end service
|
|||||||
/// Internal GoSubs
|
/// Internal GoSubs
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user