I have a lambda function with defined timeout of 10 minutes. My lambda is implemented in typescript. Very rarely, my lambda function would time out, that leads to a problem for future executions.
I want to write a worker thread at the beginning of lambda execution which could do some action if my current execution is 5 seconds away from a lambda defined timeout to make it safe for future executions.I tried playing around with promises, but thats not doing the trick.
Unfortunately, due to the system design, I cannot get this lambda to be invoked asynchronously.
Any implementation ideas?