bugtracker
bugtracker copied to clipboard
options.request_timeout is not working in KurentoClient.js
KMS Version: 6.12.0
Client libraries kurento-client kurento-client-core kurento-client-elements kurento-client-filters kurento-jsonrpc
- Language: Node.js
- Version: 10.15.3
System description: I am testing in localhost
- I wanted to pass request_timeout as option in the function getKurentoClient (The function is copied from Kurento docs website), the value is successfully passed to kurento-client->KurentoClient.js. But the request time is always the base time (20 seconds). My time has no effect.
const options = { request_timeout: 2000 };
function getKurentoClient(callback) {
if (kurentoClient !== null) {
return callback(null, kurentoClient);
}
kurento(argv.ws_uri, **options,** function(error, _kurentoClient) {
if (error) {
console.log("Could not find media server at address " + argv.ws_uri);
return callback("Could not find media server at address" + argv.ws_uri
+ ". Exiting with error " + error);
}
kurentoClient = _kurentoClient;
callback(null, kurentoClient);
});
}
Seems you are passing the setting correctly, so I'm not sure why it wouldn't apply it. I've followed the options.request_timeout
variable in the KurentoClient.js code, all the way down to kurento-jsonrpc-js//index.js
After this setTimeout
, the timeout
function should be called when the time expires, and you should see this error message: Request has timed out. Is this message always happening after 20 seconds, regardless of what you configure in options.request_timeout
?
Yes. It is always happening after 20 seconds. To check, I even changed the BASE_TIMEOUT
of KurentoClient.js to 3000. But the message is always after 20 seconds. failAfter
is working correctly. If I pass const options = { failAfter: 2 };
then it is happening as intended.
I am also facing the same issue, I changed request_timeout
to 5 seconds, but it's still taking 20 seconds