Solve launches too slow

This commit is contained in:
Junyuan Feng
2022-01-09 19:21:42 +08:00
parent 317936c521
commit 7e36c06542
4 changed files with 12 additions and 12 deletions

View File

@@ -73,8 +73,7 @@ class ServerProvider extends BusyProvider {
final auth = spi.authorization as Map<String, dynamic>;
return SSHClient(socket,
username: spi.user,
identities: SSHKeyPair.fromPem(auth['privateKey'],
auth['passphrase']));
identities: SSHKeyPair.fromPem(auth['privateKey'], auth['passphrase']));
}
Future<void> refreshData({int? idx}) async {
@@ -105,6 +104,7 @@ class ServerProvider extends BusyProvider {
locator<SettingStore>().serverStatusUpdateInterval.fetch()!;
if (duration == 0) return;
stopAutoRefresh();
Future.delayed(const Duration(milliseconds: 677), () => refreshData());
_timer = Timer.periodic(Duration(seconds: duration), (_) async {
await refreshData();
});