#Appwrite Self-hosted increase function timeout from 30s to 15mins?

9 messages · Page 1 of 1 (latest)

viral wharf
#

I created a nodejs function that talks to Stripe API and other APIs; the method takes 1 to 2 minutes before it finishes. But when deploying to appwrite self-hosted instance, it timeout within 30s,

Despite my efforts, I've been unable to find a solution to the timeout issue. I've tried changing the timeout on the UI to 900, but it's not respecting that setting.

oh, and that functions get triggered via Stripe webhook.

Any idea how to increase?, happy to do a code change if someone tell me where is that code

viral wharf
#

@uncut wedge

atomic garnet
#

If you are changing the timeout in the UI and afterward deploy it, it won't respect that / it will override the UI settings. Instead, in your appwrite.json, set the timeout for the function, e.g. like this:

   "functions": [
        {
            "$id": "...",
            "name": "...",
            "runtime": "node-18.0",
            "execute": ["any"],
            "events": [],
            "schedule": "",
            "timeout": 15, // Increase this to your desired timeout
            "enabled": true,
            "logging": true,
            "entrypoint": "dist/main.js",
            "commands": "npm install && npm run build",
            "ignore": ["node_modules", ".npm"],
            "path": "functions/..."
        },
],
viral wharf
#

@atomic garnet its already "timeout": 900,

deft turret
viral wharf
#

how? i have deployed the function and that functions get triggered by URL from Stripe Webhook, how to enable async mode?

#

@deft turret

#

the only doco i read us using nodejs sdk and execute function in async from there, but there is no doco how to make it run in async via url tirgger

deft turret