Got response error when use sleep() function in PHP and Bash
I need to do some delay in a shell script so I use sleep() to delay the execution. However when the script successfully executed, I got response error "The remote endpoint could not be called, or the response it returned was invalid." Does anyone know why this is happening? The script works fine except no response from Echo (tried both sleep() in PHP and Bash), and if I remove the sleep(), I got no errors.
I now figured out the error is because the function takes "too long" to finish according to Alexa. So I guess my function exceeds the timeout that Alexa allows. All I need to do is execute a bash script triggered by Alexa, and some delay is needed for my script. Is there anyway to set timeout for Alexa? or maybe any way I can run my bash script simultaneously with the handler function in PHP?
Hello, The Alexa timeout is 10 seconds. (i.e. your skill must return a response to Alexa within 10 seconds or be timed out). This is set by the platform and is non-configurable. I'm not sure why sleep is needed in your function without knowing the entire structure of your solution, but maybe there's a way to re-architect it, or at least to decrease the sleep value? Thanks, Levon