CodingXeer01Original post
Rank 1: Thread
Plain text
import time def main(context):
if context.req.method == "POST": context.log(context.req.body) data = json.loads(context.req.body) count = data.get('rq')
for i in range(0, count): context.log(i) time.sleep(2)
return context.res.send("200") else: return context.res.send("400")is it right way to do this, Im getting error when there is more than 7-10 count.
Summary
To send a webhook at specified times using the Appwrite function in Python, developers can use the provided code snippet. However, the error occurs when there are more than 7-10 counts due to long delays in the loop. Consider optimizing the delay mechanism or breaking down the process into smaller chunks to avoid the issue.