#Problem with Event Trigger

19 messages · Page 1 of 1 (latest)

long wasp
#

Hi!
The function is triggered, when there is 'databases..collections..documents.*.update'
but I see that the function is being executed times. Do you know why?

sturdy forge
#

That function will be executed anytime any document in any database and collection is being updated

long wasp
#
  1. Document updated --> 2. Function executed BUT why 3 times at once?
sturdy forge
#

What does the function do

#

Does it by any chance update any document

long wasp
#

It creates a summary of all markdown files, that are existing in the db

sturdy forge
#

Are you updating any document during that process

long wasp
#

it actually replaces the image names with their URLs, after getting the md content

sturdy forge
#

There you have it

long wasp
#

Thanks!

#

[SOLVED] Problem with Event Trigger

#

why exactly is it being executed 3 times? Not 4 or more, for example 😄

sturdy forge
#

Don't quote me on this but as far as I remember they have some measures in place to prevent infinite loop. Not totally sure tho

long wasp
#

Problem with Event Trigger

#

Hi! Unfortunately, it is happening the same, when just adding new documents, not changing/updating them. Do you probably have any solution? (using Python)

sturdy forge
#

Log the event string to see what event is causing it

long wasp
#

Sorry for the stupid question (as a beginner), but how to do this?

sturdy forge
#

Retrieve the event string from the header x-appwrite-event

#

Do you know how to extract headers in python functions?