Perhaps the API is using serverless and you're exp...
# suitescript
j
Perhaps the API is using serverless and you're experiencing a cold start. I'm wondering if SuiteScript 2.1 supports async await @scottvonduhn would async await be possible server side in 2.1
n
You're right, I just got a response from them, it's a .NET application that is placed in sleep mode and needs to be "warmed up", which they say is a bigger problem in the test env where we're doing tests right now than in PROD, but still it can occur in PROD as well and due to some other stuff they do in their regular operations when we do calls they recommend a timeout of at least 70 (!) seconds.. Would definitely help to have promise server side in 2.1 🙂
j
70 seconds thats a long time. Even if there's a async await type functionality server side NetSuite's never going to be able to establish a handshake with the API endpoint if the API is sleep mode.
Is this in a Suitelet server side you're attempting the post?
n
@JohnnyC you're right it's crazy but in the case of the "up-to-70-secs-problem" I believe we'd already have a handshake and would be waiting for another process the API is executing.. but still I agree.. we'll see how to solve it, won't be easy 🙂
@JohnnyC yeah for now it's a SL, could possibly be a SS too we haven't decided on the architecture yet.
j
Even with an established connection the documentation at least in SS 1.0 indicated 45 seconds for the endpoint to respond with a response after initial contact. If that's a constant in NetSuite HTTPS.post module even with a promise you'd still timeout wouldn't you
n
Correct... Will need to think about how to solve this.. I mean either way 70 seconds is crazy long in my opinion in this context so I would rather see that they posted back to us when done.. but we'll see.. Thanks alot for the help John! (would still like to know if promise comes to serverside in 2.1 just for fun) 🙂
s
I'd push back on the external API people if possible. 70 seconds in unacceptable, and they can adjust the 'sleep' behavior in .NET
j
@stalbert anything in 2.1 server side like async await, is NetSuite's https module even able to handle a wait of that duration even with a promise
n
@stalbert agreed. We're having a meeting with them next week to see what they can do, thanks for the tip about the .NET behaviour. @Lander FYI ^
l
🙂 thanks for good input guys.
s
@JohnnyC AFAIK there is no async operation for server-side script. Even if there were it would be subject to the same timeouts unless they changed those underlying timeout rules.
👍 1
j
Thanks for confirming
s
I'm actually happy we don't have that sort of behavior. IMHO server side scripts should execute sequentially, with any threading/async behavior abstracted from us by the platform.
👍 1