Skip to content

Commit fde27e9

Browse files
committed
d
1 parent f39b8ff commit fde27e9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/services/username_service.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,16 @@ class UsernameService {
128128
return;
129129
}
130130
} else {
131-
// Retry logic
131+
// Retry logic - FIXED: Use maxDelay.toDouble() instead of maxDelay
132132
delay = min(maxDelay.toDouble(), delay * 2 + Random().nextDouble());
133133
retryCount++;
134134
final statusMsg = '[RETRY $retryCount/$maxRetries] ${account.username} - Status: ${response.statusCode}, Waiting: ${delay.toStringAsFixed(2)}s';
135135
_statusController.add(statusMsg);
136136
await Future.delayed(Duration(milliseconds: (delay * 1000).round()));
137137
}
138138
} catch (e) {
139-
delay = min(maxDelay, delay * 2 + Random().nextDouble());
139+
// FIXED: Use maxDelay.toDouble() instead of maxDelay
140+
delay = min(maxDelay.toDouble(), delay * 2 + Random().nextDouble());
140141
retryCount++;
141142
final statusMsg = '[RETRY $retryCount/$maxRetries] ${account.username} - Exception: $e, Waiting: ${delay.toStringAsFixed(2)}s';
142143
_statusController.add(statusMsg);

0 commit comments

Comments
 (0)