Scripts: Sleep function in a random way / Função s... - ServiceNow Community
tiagomacul
Mega Sage

 

 

 

var intDelay = parseInt(Math.random()*10000,10);
gs.sleep(intDelay)

 

parseInt

Math.random

 

 

"Avoid using gs.sleep on any of the workflow activities. The gs.sleep does not release session; the workflow will hold on to the thread; the instance will run out of worker threads for other jobs. Use a Workflow Timer activity instead of gs.sleep." Best Practices

 

Know-More-Now-Logo.jpg

Update set Planejando e executando mudanças no ambiente.

Business Rules Async

 

Was useful, please leave your feedback!

Version history
Last update:
‎11-29-2018 04:05 AM
Updated by: