[mob] Storge cluster summary in batches

This commit is contained in:
Neeraj Gupta 2024-03-29 15:39:12 +05:30
parent ab875ea9a9
commit 44a5b97de1

View file

@ -387,6 +387,11 @@ class ClusterFeedbackService {
updatesForClusterSummary[clusterID] =
(avgEmbeedingBuffer, embedings.length);
}
// store the intermediate updates
if (updatesForClusterSummary.length > 100) {
await faceMlDb.clusterSummaryUpdate(updatesForClusterSummary);
updatesForClusterSummary.clear();
}
clusterAvg[clusterID] = avg;
}
if (updatesForClusterSummary.isNotEmpty) {