compile aggregate counts of new learners as they are prepped for ingestion to ensure that firestore internal aggregations remain accurate over time.
Added a buffer to prevent against counting the same batch of users multiple times: if an aggregate document has been edited in the last 12 hours, do not update it again. The exception is for documents created within the last hour (to allow for users who are the first in their country to be ingested to be counted)
compile aggregate counts of new learners as they are prepped for ingestion to ensure that firestore internal aggregations remain accurate over time. Added a buffer to prevent against counting the same batch of users multiple times: if an aggregate document has been edited in the last 12 hours, do not update it again. The exception is for documents created within the last hour (to allow for users who are the first in their country to be ingested to be counted)