you might need to create a document and store the data in there
I thought the data from creating the execution would have the response in it
so I could just wait until the getExecution
status is okay, checking every X timeout depending on the function, and then the response should have it right?
@HolyByte, The Iron Oxide Jedi
No. Since 1.4, we don't store the response anymore
huh, okay so if I want a non-blocking asynchronous function that returns data, do you have an example of that or is that just not intended at all?
Cause at that point, in any high level application with thousands of requests, my functions are pretty worthless in that regard
Not intended. Long running synchronous functions don't scale.
this one isn't long running, nor are my others
I actually am not sure why it timed out
Cause that one is literally just "getUserByAppwriteId" basically
it gets a document and returns it, nothing else was running
Then something is wrong with your code
how can it be? It's above
it's just getting the appwriteId (which it does cause it's logged) then it does getDocument
could the Bun runtime have an issue?
Try executing your function asynchronously and increasing the timeout. Maybe you'll see the real error
I'm genuinely asking here, if the Appwrite ID is in the given function above (which it is valid and present), shouldn't it always either fail or not fail? What other possible thing could be happening here where you're thinking there's an error I'm missing? Cause it's just using getDocument, am I missing something?
it works 99% of the time, it just failed a few times randomly
and usually in 13-15 ms
I'm not sure
huh, weird, okay, thank you regardless, do you guys have any plans to write a wrapper for function responses via like idk websockets or something? It would be cool to be able to run ~3-5 second functions asynchronously and have them return the response appropriately, I was thinking setTimeout but if they don't have the responseBody it doesn't work so I was maybe thinking Webhooks. They're not meant to be scalable per-se, but AI functions sometimes take a second to return a response, it's not computationally heavy just an API
Not at the moment.
The response body is supposed to be able to be anything now. As such, Appwrite can't store it
gotcha, understood, thank you!
[SOLVED] Simple Function Timing Out
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...