Page 1 of 1

HTTPTimeout

Posted: Tue May 23, 2023 8:38 pm
by hoerbie
Hi,
as PB now has the awaited feature to set a timeout for the http requests, I think this could be useful in SB too.
Until now I use something like the following to set a timeout in milliseconds:

Code: Select all

Procedure HTTPTimeout(msec.i)
  ! $.ajaxSetup({ timeout: v_msec });
EndProcedure
But this only seems to work for HTTPRequest but not for the Load*() commands...
Greetings from hoerbie

Re: HTTPTimeout

Posted: Thu May 25, 2023 8:18 am
by Fred
Makes sense, I will add it. For Load*() an optional param will be probably enough.

Re: HTTPTimeout

Posted: Fri May 26, 2023 11:07 am
by hoerbie
@Fred: sounds good :)
When you add it, maybe you can add it more the same way like in PB, that HTTPTimeout sets a variable in the background and this variable is then read when a new HTTPRequest() is called, and then set directly for the next $.ajax call.
Because I think my way of using $.ajaxsetup could be problematic when doing multiple faster and slower calls in the same time and setting a short timeout as default while a slow request is done, to not get problems, until now m only using one HTTPRequest() or Load*() at the same time.

When adding a timeout to the Load*() functions an optional param would be OK.