I have a function in Lambda that executes for up to 30s depending on the inputs. That function is linked to an API gateway so I am able to call it through POST, unfortunatly the API Gateway is limited to 30s exaclty, so if my function runs for longer I get an "internal server error" back from my POST.
I see 2 solutions to this:
- Create a "socket" rather then a simple POST which connects to the lambda function, not sure if this is even possible or how would this work.
- Return a notification to api gateway before the lambda function is actually finished. This is acceptable for my use case, but I am not sure again how would this work.
The function is coded in Python3.6 I therefore have access to the event and context object.