Admin
you might need to create a document and store the data in there
Votes
0
Replies
24
Participants
Unknown
Messages
25
Admin
you might need to create a document and store the data in there
Moderator
I thought the data from creating the execution would have the response in it
Moderator
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?
Moderator
@HolyByte, The Iron Oxide Jedi
Admin
No. Since 1.4, we don't store the response anymore
Moderator
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?
Moderator
Cause at that point, in any high level application with thousands of requests, my functions are pretty worthless in that regard
Admin
Not intended. Long running synchronous functions don't scale.
Moderator
this one isn't long running, nor are my others
Moderator
I actually am not sure why it timed out
Moderator
Cause that one is literally just "getUserByAppwriteId" basically
Moderator
it gets a document and returns it, nothing else was running
Admin
Then something is wrong with your code
Moderator
how can it be? It's above
Moderator
it's just getting the appwriteId (which it does cause it's logged) then it does getDocument
Moderator
could the Bun runtime have an issue?
Admin
Try executing your function asynchronously and increasing the timeout. Maybe you'll see the real error
Moderator
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?
Moderator
it works 99% of the time, it just failed a few times randomly
Moderator
and usually in 13-15 ms
Admin
I'm not sure
Moderator
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
Admin
Not at the moment.
The response body is supposed to be able to be anything now. As such, Appwrite can't store it
Moderator
gotcha, understood, thank you!
Moderator
[SOLVED] Simple Function Timing Out