Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

timeout on service call

I have just added email functionality to a registration service which is on an external service. My code works as it should and sends a welcome email to new registrants of my app.

However the appery times out and returns the following message:

pre{
"code": "AE015",
"message": "Execution of the service has exceeded the allowed time and stopped",
"status": "REQUEST_TIMEOUT"
}/pre

Can the allowed allowed execution time be extended to avoid this error?

Would it help if I sent the email as a different service called in the success event of the registration service, or is that still considered to be executing the original script?

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

timeout on service call

Terry,

Since you're calling two separate API's the script is waiting for the Internet round trip on both ... which in and of itself is most of the execution time allowed. API express may be worth pursuing? Or as you mentioned ... two server scripts ?

Happy Tuesday,
Bruce

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

timeout on service call

Thanks for the reply Bruce,

It is currently a single call using API express.
This sends a request to my external php rest service. The execution timeout appears to be related to the amount of time that my service takes to execute before returning the response back to API express.

If I split it into two calls, I would need the response from the first to send the second request, so that it would have to be in the success event of the first. If this is done, then I suppose that the first call hasn't terminated until its success event has terminated, which will have to wait for the termination of the second call.

So I am not sure if this is going to help.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

timeout on service call

Hello Terry,

The Timeout Limit is related to your current plan: https://appery.io/pricing/
There are no any other way to increase that limit.
Please check the Sendgrid plugin to send emails: https://docs.appery.io/docs/servercod...

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

timeout on service call

It seems to be working now, which is a bit worrying, since I have not made any significant changes. I suspect it may happen again. Is there any way of checking how long my scripts are taking to execute, to see if I am close to the limit?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

timeout on service call

It depends on the type of the API Express service you call.

If you use a one, which is built with API Express visual editor - you can add two JS components on the very begin and end of that service to show a current date there.

If you use autogenerated one - please run the same JS code on the "before send" and "success" events.

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

timeout on service call

Thanks Serhii, I'll look into that

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

timeout on service call

Ok, using console.time() My script took :

register: 3513.000244140625ms.

which leaves about 1.5 secs to spare, I guess that is ok

Return to “Issues”