Verbose retry counter
This commit is contained in:
parent
c57382dfa4
commit
99e0f9ae91
1 changed files with 11 additions and 2 deletions
|
@ -83,9 +83,16 @@ class ServerPage extends StatelessWidget {
|
|||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content:
|
||||
Text("Login Success - Downloading remote Settings")));
|
||||
|
||||
int retryCount = 0;
|
||||
while (true) {
|
||||
try {
|
||||
await Future.delayed(Duration(seconds: 5));
|
||||
if (retryCount > 0)
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
"> Retrying to download settings in 10 seconds (Attempt $retryCount")));
|
||||
|
||||
await Future.delayed(Duration(seconds: 10));
|
||||
S2CResponse settingsData = await settings.client!
|
||||
.send(C2SRequestSettingsPacket(), true);
|
||||
C2SRequestSettingsPacket settingsBack =
|
||||
|
@ -93,7 +100,9 @@ class ServerPage extends StatelessWidget {
|
|||
settingsBack.decodeTag(settingsData.contents);
|
||||
settingsBack.handleClientPacket();
|
||||
break;
|
||||
} catch (E) {}
|
||||
} catch (E) {
|
||||
retryCount++;
|
||||
}
|
||||
}
|
||||
|
||||
Navigator.pushNamed(context, "/home");
|
||||
|
|
Loading…
Reference in a new issue