v1.8.66: fix 7 Redis bugs — shlex parser, GUI stats, SSL, error handling, dedup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -188,18 +188,14 @@ class RedisTab(ctk.CTkFrame):
|
||||
client = self._get_client()
|
||||
db = int(self._db_var.get())
|
||||
client.select_db(db)
|
||||
keys_count = client.execute("DBSIZE")
|
||||
info = client.execute("INFO memory")
|
||||
|
||||
# Parse memory from INFO output
|
||||
memory = "—"
|
||||
if isinstance(info, str):
|
||||
for line in info.split("\r\n"):
|
||||
if line.startswith("used_memory_human:"):
|
||||
memory = line.split(":")[1].strip()
|
||||
break
|
||||
# Прямые методы возвращают int и dict, не форматированные строки
|
||||
keys_count = client.dbsize()
|
||||
info = client.info("memory")
|
||||
|
||||
memory = info.get("used_memory_human", "—") if info else "—"
|
||||
keys_text = f"{keys_count:,}" if keys_count is not None else "—"
|
||||
|
||||
keys_text = str(keys_count) if keys_count is not None else "—"
|
||||
self.after(0, lambda: self._keys_label.configure(
|
||||
text=t("redis_keys") + f": {keys_text}"))
|
||||
self.after(0, lambda: self._memory_label.configure(
|
||||
|
||||
Reference in New Issue
Block a user