50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
Compile function OENGINE_HEARTBEAT(@Service, @Params)
|
|
#pragma precomp SRP_PreCompiler
|
|
declare function GetCommandLine
|
|
Declare function Database_Services, SRP_TcpClient, Environment_Services
|
|
Declare subroutine SRP_TcpClient
|
|
|
|
|
|
$Insert LOGICAL
|
|
$insert SERVICE_SETUP
|
|
|
|
|
|
|
|
|
|
GoToService else
|
|
null
|
|
end
|
|
|
|
Return Response else ''
|
|
|
|
Service Run()
|
|
|
|
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
|
Lock hSysLists, ServiceKeyID then
|
|
CommandLine = GetCommandLine()
|
|
Server = Environment_Services('GetServer')
|
|
Env = ''
|
|
Begin Case
|
|
Case Server EQ 'MESTSA01EC' OR Server EQ 'MESSA01EC'
|
|
Env = 'DB'
|
|
Case Server EQ 'MESSA005' OR Server EQ 'MESSA012'
|
|
Env = 'APP'
|
|
End Case
|
|
//test = Indexc(CommandLine, '/S=EN', 1)
|
|
|
|
IF Indexc(CommandLine, '/S=EN', 1) then
|
|
EngineTag = Indexc(CommandLine, '/S=EN', 1) + 3
|
|
EngineNo = CommandLine[EngineTag, 999]
|
|
|
|
If SRP_TcpClient(TcpClientHandle, "CONNECT", "127.0.0.1", "13000") then
|
|
SRP_TcpClient(TcpClientHandle, "SEND", Env:'-':EngineNo)
|
|
SRP_TcpClient(TcpClientHandle, "CLOSE")
|
|
end
|
|
|
|
end
|
|
ClearSelect 0
|
|
end
|
|
Unlock hSysLists, ServiceKeyID else Null
|
|
|
|
end service
|