Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix smart album auto-add after face recognition (#12413)

Laurens Priem3129a7bdef75
diff --cc mobile/apps/photos/lib/services/machine_learning/ml_service.dart
index 538fe62d66,4847b50130..263e02258e
--- a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
@@@ -464,17 -473,16 +464,22 @@@ class MLService
_logRunStopped(control, "before post-run cache scheduling");
return MlRunDisposition.stopped;
}
+ await PersonService.instance.sync();
+ if (control.stopRequested) {
+ _logRunStopped(control, "after post-run person sync");
+ return MlRunDisposition.stopped;
+ }
if (_mlControllerStatus == true) {
- // Persist refreshed caches after ML so foreground can pick them up
- // on the next resume, even when the work ran headlessly in background.
- magicCacheService.updateCache().ignore();
- memoriesCacheService.updateCache(forced: force).ignore();
+ await magicCacheService.updateCache(forced: force);
+ if (control.stopRequested) {
+ _logRunStopped(control, "after magic cache refresh");
+ return MlRunDisposition.stopped;
+ }
+ await memoriesCacheService.updateCache(forced: force);
+ if (control.stopRequested) {
+ _logRunStopped(control, "after memories cache refresh");
+ return MlRunDisposition.stopped;
+ }
}
return MlRunDisposition.completed;
} finally {