Hello guys,
I run an execution Execution execution = await functions.getExecution(
functionId: functionId, executionId: executionId); which call the Completation Chat API from OpenAI.
Since it took more than 30 seconds and I got the error Operation timed out after 30000 milliseconds
So I defined an async function:
`Execution result = await functions.createExecution( functionId: '65fd719a000f460e4896', body: body, method: 'POST', headers: headers, xasync: true);
var executionId = result.$id;
Execution execution = await functions.getExecution(
functionId:functionId, executionId: executionId);
while (
execution.status == 'waiting' || execution.status == 'processing') {
await Future.delayed(Duration(seconds: 5));
execution = await functions.getExecution(
functionId: functionId, executionId: executionId);
}`
The function is completed but I get the following error FormatException: SyntaxError: Unexpected end of JSON input
print(result.responseBody); does not print anything but I can see in the Admin console the body printed which is a valid JSON.
Why do I have the problem?
Recommended threads
- Worker functions stuck on "Fetched 0 fun...
Appwrite Version: 1.9.0 Bug Description: The appwrite-worker-functions container gets stuck in an infinite loop logging "Fetched 0 functions..." while scheduled...
- I am using s3 for app storage but is it ...
_APP_STORAGE_DEVICE=s3 puts everything to the s3 storage but i need to be able to keep the function builds and site in the local and not waste the cloud storage...
- Local Serverless Function Testing: Are D...
I have followed the instructions to get the CLI working, and have been able to log-in, initialize my project, and created a simple Python function, which calls ...