user2076214
user2076214

Reputation: 11

How to increase the adapter procedure timeout value in Worklight?

How can I increase the timeout value of a Worklight adapter procedure? My app crashes and I see the following in the exception details:

"response [/apps/services/api/index/common/query] success: /-secure- {"responseID":"24","errors":["Invocation of procedure 'getFTTitle' has timed out after 30 sec."],"isSuccessful":false,"warnings":[],"info":[]}/ "

Upvotes: 1

Views: 3952

Answers (2)

Matt Cobb
Matt Cobb

Reputation: 405

var wlInitOptions = 
{
    // # Worklight server connection timeout
    timeout: 60000,
    ...
}

Upvotes: -1

Idan Adar
Idan Adar

Reputation: 44516

There are several places in Worklight where a timeout value can be specified:

CLIENT ----> WORKLIGHT SERVER -- (adapter) --> BACKEND

You can increase the adapter procedure timeout (Worklight Server --> Backend) as follows:

<procedure name="nameHere" requestTimeoutInSeconds="valueHere"/>

I don't know what is your specific use case, so be sure to also increase the client-side timeout. Have them match each other.

WL.Client.invokeProcedure(invocationData,{
    onSuccess : getDataSuccess,
    onFailure : getDataFailure,
    timeout   : valueHere
});

Also note that if you need to increase your timeout to a whole minute, consider that something may not be right here...

Upvotes: 6

Related Questions