Update: 2026-05-08 15:19:08

This commit is contained in:
Hamza-Ayed
2026-05-08 15:19:08 +03:00
parent 07fd3f9ba7
commit 72424bf92c
2 changed files with 13 additions and 4 deletions

View File

@@ -170,8 +170,15 @@ class ScannerController extends GetxController {
}
void _startPolling(String batchId) {
// Check status every 2 seconds
bool firstPoll = true;
// Check status periodically
Future.doWhile(() async {
// Wait before checking
// First poll is after 8 seconds (AI takes time), subsequent are 5 seconds
await Future.delayed(Duration(seconds: firstPoll ? 8 : 5));
firstPoll = false;
// If we are no longer interested in this batch or it's done, stop polling
if (currentBatchId.value != batchId || isBatchDone.value) return false;
@@ -204,7 +211,6 @@ class ScannerController extends GetxController {
AppLogger.error('Polling error', e);
}
await Future.delayed(const Duration(seconds: 2));
return true; // Continue polling
});
}