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
|
||||
ReadNext RequestKeyID else EOF = True$
|
||||
Until EOF
|
||||
SendRequest = True$
|
||||
Read RequestRec from hProcQueue, RequestKeyID then
|
||||
InQueue = RequestRec<PROC_QUEUE.IN_QUEUE$>
|
||||
SendRequest = True$
|
||||
InQueue = RequestRec<PROC_QUEUE.IN_QUEUE$>
|
||||
If InQueue then
|
||||
QueuedDtm = RequestRec<PROC_QUEUE.QUEUED_DTM$>
|
||||
If QueuedDtm GT SRP_Datetime('AddMinutes', Datetime(), -10) then
|
||||
SendRequest = False$
|
||||
end
|
||||
end
|
||||
end
|
||||
If SendRequest then
|
||||
TcpClientHandle = 0
|
||||
If SRP_TcpClient(TcpClientHandle, 'CONNECT', ServerIP, ServerPort) then
|
||||
RequestRec<PROC_QUEUE.IN_QUEUE$> = True$
|
||||
RequestRec<PROC_QUEUE.QUEUED_DTM$> = Datetime()
|
||||
Write RequestRec on hProcQueue, RequestKeyID then
|
||||
Command = 'RUN SERVICE_SERVICES "ProcessRequest", ':Quote(RequestKeyID)
|
||||
SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command)
|
||||
end
|
||||
SRP_TcpClient(TcpClientHandle, 'CLOSE_SES')
|
||||
end
|
||||
If SendRequest then
|
||||
TcpClientHandle = 0
|
||||
If SRP_TcpClient(TcpClientHandle, 'CONNECT', ServerIP, ServerPort) then
|
||||
RequestRec<PROC_QUEUE.IN_QUEUE$> = True$
|
||||
RequestRec<PROC_QUEUE.QUEUED_DTM$> = Datetime()
|
||||
Write RequestRec on hProcQueue, RequestKeyID then
|
||||
Command = 'RUN SERVICE_SERVICES "ProcessRequest", ':Quote(RequestKeyID)
|
||||
SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command)
|
||||
end
|
||||
SRP_TcpClient(TcpClientHandle, 'CLOSE_SES')
|
||||
end
|
||||
end
|
||||
end
|
||||
Repeat
|
||||
end
|
||||
@ -474,4 +474,3 @@ end service
|
||||
/// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user