OCI Functions Timeout scenarios when Invoked via API Gateway with Node.js Application
I've tried everything I can think of but Quick question that's been bugging me - Quick question that's been bugging me - Hey everyone, I'm running into an issue that's driving me crazy... I'm experiencing a timeout scenario when invoking my Oracle Cloud Infrastructure (OCI) Function through the API Gateway. The function is built in Node.js (version 14) and is expected to return a response within a few seconds. However, after about 30 seconds, I'm getting a `504 Gateway Timeout` behavior. I have verified that my function works perfectly when invoked directly from the OCI Functions console. Here's a snippet of my function code: ```javascript const handler = async (event) => { // Simulating some processing time await new Promise(resolve => setTimeout(resolve, 20000)); // 20 seconds return { statusCode: 200, body: JSON.stringify({ message: 'Function executed successfully!' }) }; }; exports.handler = handler; ``` I have set the timeout for the function to 60 seconds, and the API Gateway is also configured to allow for the same timeout. In the API Gateway console, I set the integration timeout to 30 seconds, but it seems that the function execution is being cut off before it can complete. I’ve checked the logs in both the function and the API Gateway, and the function log shows that it starts executing but doesn't complete before the API Gateway times out. I tried increasing the timeout value in the API Gateway settings, but it still yields the same behavior. Is there something I'm missing in the configuration, or is there a recommended best practice when setting timeouts in OCI Functions and API Gateway integration? Any insights or suggestions would be greatly appreciated! My development environment is Linux. Thanks for your help in advance! I'm on Linux using the latest version of Javascript. How would you solve this?