Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Fix remote fetch counter

laurenspriem8bf29ee82fb9
diff --git a/mobile/lib/services/machine_learning/ml_service.dart b/mobile/lib/services/machine_learning/ml_service.dart
index 1c2542206f..77b0597e97 100644
--- a/mobile/lib/services/machine_learning/ml_service.dart
+++ b/mobile/lib/services/machine_learning/ml_service.dart
@@ -110,7 +110,10 @@ class MLService {
bool canFetch() {
if (localSettings.isMLIndexingEnabled) return true;
- if (lastRemoteFetch == null) return true;
+ if (lastRemoteFetch == null) {
+ lastRemoteFetch = DateTime.now().millisecondsSinceEpoch;
+ return true;
+ }
final intDiff = DateTime.now().millisecondsSinceEpoch - lastRemoteFetch!;
final bool canFetch = intDiff > _kRemoteFetchCooldownOnLite;
if (canFetch) {