File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments