Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob] Minor improvement in magicSearch cache refresh

Neeraj Gupta08cf14a72b4d
diff --git a/mobile/lib/services/machine_learning/ml_service.dart b/mobile/lib/services/machine_learning/ml_service.dart
index c643bd20ff..c09b6874bd 100644
--- a/mobile/lib/services/machine_learning/ml_service.dart
+++ b/mobile/lib/services/machine_learning/ml_service.dart
@@ -117,7 +117,6 @@ class MLService {
try {
if (force) {
_mlControllerStatus = true;
- MagicCacheService.instance.queueUpdate('forced run');
}
if (_cannotRunMLFunction() && !force) return;
_isRunningML = true;
@@ -134,7 +133,7 @@ class MLService {
}
if (_mlControllerStatus == true) {
// refresh discover section
- MagicCacheService.instance.updateCache().ignore();
+ MagicCacheService.instance.updateCache(forced: force).ignore();
}
await indexAllImages();
if ((await MLDataDB.instance.getUnclusteredFaceCount()) > 0) {
diff --git a/mobile/lib/services/magic_cache_service.dart b/mobile/lib/services/magic_cache_service.dart
index 3178e8c4ca..ecb4c4629f 100644
--- a/mobile/lib/services/magic_cache_service.dart
+++ b/mobile/lib/services/magic_cache_service.dart
@@ -205,7 +205,7 @@ class MagicCacheService {
queueUpdate("Prompts data updated");
} else if (lastMagicCacheUpdateTime <
DateTime.now()
- .subtract(const Duration(days: 1))
+ .subtract(const Duration(hours: 12))
.millisecondsSinceEpoch) {
queueUpdate("Cache is old");
}