Does Netsuite has some sort of sleep for server si...
# suitescript
f
Does Netsuite has some sort of sleep for server side scripts?
b
no.
plusone 1
common workarounds are yielding/rescheduling or writing a loop that wastes time
s
I hope the loop that wastes time is not common 🙂. Another solution here is to write a separate (scheduled/mr) script for the polling portion
b
s
I cry a little when I see something like that.
fortunately, NS has instruction count limits to prevent abuse
b
uncommon workaround is making slow http requests using something like http://slowwly.robertomurray.co.uk. You should have your own endpoint if you are doing this seriously
b
I just ran a test and on a Suitelet I was able to run the time waster function for 3 minutes without issues
b
suitelets dont time out easily
s
I'm amazed one wouldn't hit the instruction limit governance in < 3 minutes
f
Unfortunately I am implementing a plugin where I can’t “outsource” or split this
a
@fkrauthan Try a different approach, there should be a better way to do what you need, coding wise or design wise.
f
well given that the plugin callback tells me what data it needs and expects them returned right away there is not much of a choice. Probably gonna change the server endpoint to be blocking
s
if you can, that's great. fundamentally suitescript is synchronous, so if you have an API designed for async usage it's not going to be pretty in the scenario you describe.
a
@fkrauthan That is when design and architecture comes into place, but without knowing more details it will be hard for anyone here to give you a different idea.