Anyone know how to introduce a 'delay' in suitescr...
# suitescript
d
Anyone know how to introduce a 'delay' in suitescript? I've got try/catch retry logic, but I want to intro a delay before the retry. Server side of course
b
most basic approach is to do something like:
Copy code
while (Date.now() < someNumber) {}
if for some terrible reason you hit instruction count limits you need to be more creative
i know of making a https request to a server that returns after a period of time
200iq 1
d
Ya, I'm already pushing execution limits. I like the idea of an external http call to slow me down. Is there a delay service I can use?
b
nothing that i can share
you can probably make one in netsuite using a suitelet if you want
j
While this can work
Copy code
while (Date.now() < someNumber) {}
Spinlocking the shared server is probably unkind to its other tenants
If you're on a shared tier that is
I like the idea of using NetSuite's own slowness in a suitelet as a delay though 😂
d
LOL
One last question. how long before https request times out?
b
5 second connect time, 45 seconds total
👍 1
j
I like the idea of using NetSuite's own slowness in a suitelet as a delay though 😂
I've actually done that before