diff --git a/lib/features/redis/redis_keys_view.dart b/lib/features/redis/redis_keys_view.dart index afaedb4b..48e7d25e 100644 --- a/lib/features/redis/redis_keys_view.dart +++ b/lib/features/redis/redis_keys_view.dart @@ -76,17 +76,17 @@ class _RedisKeysViewState extends material.State { count: 100, ); - // Fetch type and TTL for each key - final infos = <_KeyInfo>[]; - for (final name in keyNames) { + // Fetch type and TTL for each key concurrently + final futures = keyNames.map((name) async { try { final type = await widget.connection.keyType(name); final ttl = await widget.connection.ttl(name); - infos.add(_KeyInfo(name: name, type: type, ttl: ttl)); + return _KeyInfo(name: name, type: type, ttl: ttl); } catch (_) { - infos.add(_KeyInfo(name: name, type: 'unknown', ttl: -1)); + return _KeyInfo(name: name, type: 'unknown', ttl: -1); } - } + }); + final infos = await Future.wait(futures); if (!mounted) return; setState(() {