Day 2 of trying Appwrite Functions 🙂
I have a function which monitors when a document is created or updated and then if media files information in a document field shows that thumbnails for media were not generated, it triggers thumbnail generation, stores them in Storage and then updates media files information (IDs in Storage).
I noticed that first run of the function triggers another run, which is while it's fast (3ms) can add up on large volumes of requests I think, so I'm wondering if there is a mechanism which allows to avoid triggering of an event when calling document update API from a function which uses server API or otherwise.
Even if I check x-appwrite-user-id
for example (end function if it's empty) it still runs the function which has sharp/libvips & ffmpeg, so kinda expensive I think.
Thanks.
BTW, I noticed a small bug in preview endpoint - it doesn't consider orientation of photos (previews are sideways when photos are displayed correctly in browsers/viewers which consider orientation) - I think appwrite uses sharp/libvips based on API parameter values for the endpoint, if so a simple additional .rotate()
call without parameters when generating preview should fix this issue
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...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...