GlideAjax Timeout from UI Page

nichoffman
Kilo Expert

Hello,

We created a dedicated UI Page to launch a server side script while providing it with parameters.

To do so, we call a client callable Script Include using GlideAjax.

On client side, we basically wait for the server to answer to provide the user with a status on the page.

Depending on the parameters, the process could take from 30 seconds up to several minutes.

This how we noticed a timeout period of 300 seconds. I haven't found anything about increasing this periode whether it's as an Ajax parameter or function or at system property level.

Does anyone know hw I could extend this timeout?

Regards,

Nicolas

1 ACCEPTED SOLUTION

Hello Paul,



Thanks for the answer. I don't know if your solution would work or not.


Anyway, we found a workaround:


User submits his paramaters.


It creates an event that launches then a Script Action perofrming the process.


At the end of it, the user simply receives an Email.



About the script, this feature is not meant to be used often. It's meant to manually launch recalculations Service Availabilities based on outages on custom instances of Service Offerings in a periode chosen by the user.


At first we had hours of calculation and by changing the availability logic, we reduced it to a few minutes.


View solution in original post

7 REPLIES 7

Hi Tomasi,

 

Thank you!

We are facing same issue when User clicks the Submit button from UI page, It keeps running and finally transaction is closed but still all records are not updated from the script include function.

To fix issue, have increased max duration to 1000 sec from 298 sec for UI transaction record of Transaction quota rule table, it is working now. 

 

Is there any impact on system if increased 1000 sec (30 mins) for existing UI Transaction record?

OR Can I create a new record for UI page transaction only?

 

 

 

The SN Nerd
Giga Sage
Giga Sage

You could use the setTimeout() function with a timeout that matches the system transaction quota.


This could call a method the prints out a user friendly message indicating a timeout and could even run the GlideAjax query again.



Window setTimeout() Method



Really though, it there ever a good reason for a server side call to be taking more than 300 seconds?



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hello Paul,



Thanks for the answer. I don't know if your solution would work or not.


Anyway, we found a workaround:


User submits his paramaters.


It creates an event that launches then a Script Action perofrming the process.


At the end of it, the user simply receives an Email.



About the script, this feature is not meant to be used often. It's meant to manually launch recalculations Service Availabilities based on outages on custom instances of Service Offerings in a periode chosen by the user.


At first we had hours of calculation and by changing the availability logic, we reduced it to a few minutes.