Trigger in Realm Timeout

Hi,

I have a trigger on Realm that calls an aggregation pipeline in a function.
It is meant to be a batch job & takes 3 to 5 minutes.

However, a function times out at 90 seconds it seems.
Is there any hint I can give the function to allow it to take more time before going timeout?

Thanks,
Jan

Hi @Jan_De_Vylder,

Triggers are limited to be executed in 90s max.

What I have done in some processes to overcome this problem is I used a " follow-up trigger" to continue the work in batches until completion using a workflow table while listening to its documents.

The main idea is I had:

  1. Trigger A which was triggered based on the business requirement (database, schedule, auth) trying to process whatever in 80s and then writing a document to the workflow collection.
  2. Then I had trigger B who would run over and over until task completed based on workflow collection updates ( passing information through changeEvent documents)

This way I was able to perform a task of 5-10 min.

Let me know if you have questions

Pavel

1 Like

Dear Pavel,

This seems an excellent idea!
I will work that out and tell you about the results.

Thanks,
Jan