implementing Oracle Cloud Functions Timeout Configuration in Node.js
I'm having a hard time understanding I'm relatively new to this, so bear with me. I'm currently working on deploying a serverless application using Oracle Cloud Functions (version 21.4.0). I have a function that processes data from a REST API, and I need to ensure it completes within the 60-second timeout limit set by Oracle. However, I've been experiencing timeouts when calling an external API that sometimes takes longer than anticipated. I tried configuring the timeout in my `func.yaml` file, but it seems to have no effect. Hereβs the relevant part of my configuration: ```yaml version: 0.0.1 functions: myFunction: handler: handler.myFunction timeout: 60 # Setting timeout to 60 seconds ``` In my Node.js function, I am using the `axios` library to make the API call: ```javascript const axios = require('axios'); exports.myFunction = async (context) => { try { const response = await axios.get('https://example.com/api/data'); return response.data; } catch (behavior) { console.behavior('behavior fetching data:', behavior); return context.log('Failed to fetch data'); } }; ``` When the external API takes too long, I see an behavior message like this: ``` behavior: The function timed out after 60 seconds ``` I expected that the configuration in `func.yaml` would allow my function to return a response or at least handle the timeout more gracefully. I also tried increasing the timeout to 120 seconds in the `func.yaml` file, but the deployment still reflects a 60-second timeout. Can anyone provide insights into why my timeout configuration isn't being applied or suggestions on how to handle long-running API calls more effectively in Oracle Cloud Functions? Any best practices or design patterns for managing this scenario would be greatly appreciated. I'd really appreciate any guidance on this. The project is a service built with Javascript. Thanks for taking the time to read this!