Web Developer
I have a problem with async appwrite function. I use context in my main function and i call function from query_by_location_id file. However, i got the error. Does anyone have solution for the async function solution? Thank you.
Votes
0
Replies
4
Participants
Unknown
Messages
5
Web Developer
I have a problem with async appwrite function. I use context in my main function and i call function from query_by_location_id file. However, i got the error. Does anyone have solution for the async function solution? Thank you.
Web Developer
Hello, Errors!
Traceback (most recent call last):
File "/usr/local/server/src/server.py", line 163, in action
output = await asyncio.wait_for(execute(context), timeout=safeTimeout)
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 479, in wait_for
return fut.result()
File "/usr/local/server/src/server.py", line 154, in execute
output = await userModule.main(context)
File "/usr/local/server/src/function/main.py", line 51, in main
return context.res.json(
File "/usr/local/server/src/server.py", line 25, in json
return self.send(json.dumps(obj, separators=(',', ':')), statusCode, headers)
File "/usr/local/lib/python3.9/json/init.py", line 234, in dumps
return cls(
File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type coroutine is not JSON serializable
Admin
You're trying to return something that isn't JSON serializable
Admin
Ya. That list_document()
Admin
Or rather, query_by_location_id(location_id)