-
Notifications
You must be signed in to change notification settings - Fork 1
Description
ULTriggerRecompute trigger a cloud function that runs for 9 minutes(max exec time), querying MySQL to compute UL stats every 400ms.
Not good as we go for the limit of the cloud function exec, and can be failing
Instead :
Cloud Scheduler triggered ULTriggerRecompute cloud function, post a message with {current_index:0, ul_id:[348,398,....]} on ul_update topic (select on the DB to get UL that are using RCQ, ie at least one TroncQueteur Recorded this year)
Then a cloud function listen to the message, and query UL at index "current_index" compute stats and store it in RQ Firestore, and then post a message with {current_index:index++} on the same topic, until we reach the end of the array.
At the end of the array, we don't repost with current_index=0/.
It will be done with ULTriggerRecompute that may include more UL (especially in the beginning of the quete)