From a211f2822e74211b1b8d91b56f47201b62bf583c Mon Sep 17 00:00:00 2001 From: mokaddem Date: Wed, 31 Oct 2018 15:56:11 +0100 Subject: [PATCH] chg: [doc] update doc --- README.md | 3 +-- clean.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b8d078..e302638 100644 --- a/README.md +++ b/README.md @@ -122,8 +122,7 @@ Happy hacking ;) ## Restart from scratch -To restart from scratch and empty all data from your dashboard you can use the [FLUSHDB](https://redis.io/commands/flushdb) or [FLUSHALL](https://redis.io/commands/flushall) command on your redis instance on port `6250`. -Or use the dedicated cleaning script ``clean.py`` +To restart from scratch and empty all data from your dashboard you can use the dedicated cleaning script ``clean.py`` ```usage: clean.py [-h] [-b] Clean data stored in the redis server specified in the configuration file diff --git a/clean.py b/clean.py index e8838d4..061321d 100755 --- a/clean.py +++ b/clean.py @@ -72,7 +72,9 @@ def cleanSoft(servers): for db, keys in prefix_keys_per_db.items(): serv = servers[db] for k in keys: + # fetch all keys on the db key_to_del = serv.keys(k) + # delete all existing keys if len(key_to_del) > 0: serv.delete(*tuple(key_to_del))