SetHttpTimeout does not exist in Lua scrpt

Calling the SetHttpTimeout inside the Lua script gives this error:

E0318 19:33:06.835295 OrthancException.cpp:57] Cannot execute a Lua command: [string "line"]:2: attempt to call a nil value (global 'SetHttpTimeout')

Full lua script is:

function OnStoredInstance(instanceId, tags, metadata, origin)
	SetHttpTimeout(2)
	HttpGet("http://localhost:8001/callback?id=" .. instanceId .. "&origin=" .. DumpJson(origin))
end

Orthanc version: 1.9.7
Lua version: Lua 5.3
Referring the documentation here - Server-side scripting with Lua — Orthanc Book documentation

Could this be a Orthanc version issue? If so I would be happy to contribute to update the documentation.

Thank you!

Hi Adarsh,

Yes, this function has actually been introduced in Orthanc 1.11.1. I have updated the documentation. Thanks for reporting the issue.

If you are using a Linux Package and want to update to latest version, you may follow this procedure.

HTH,

Alain.

1 Like

Great, thank you so much!!