How do I prevent loops from being triggered?

Updated at:
Copy as MD

When a function writes files back to the same Object Storage Service (OSS) bucket that triggered it, a loop forms: each write generates a new trigger event, which runs the function again, which writes more files, and so on.

To break the loop, use separate prefixes in the same bucket. Configure the trigger to fire only on a specific prefix — for example, src/ — and write output to a different prefix, such as dst/. Objects written to dst/ do not match the trigger filter, so they do not invoke the function again.