-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
remove_by_name() | ||
{ | ||
local query; query="$1" | ||
local q | ||
|
||
redis-cli KEYS "$query" | while read -r q; do | ||
redis-cli DEL "$q" | ||
done | ||
} | ||
|
||
if [ -z "$1" ]; then | ||
echo Usage: | ||
echo | ||
echo " $0 QUERY" | ||
exit 1 | ||
fi | ||
|
||
remove_by_name "$1" |
84a9ca3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where
share/scripts
is intended to be used? There is also similarbin/clean_cache.py
84a9ca3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean they must be grouped together?
You mean,
bin/
is a wrong location for the clean_cache.py script,and it should be moved to this directory?
84a9ca3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure. I don't know how are they used.
bin/
looks like a place for scripts that use application libs and config thanshare/
.84a9ca3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script is used to remove invalid entries from the cache. It was a quick hack, and it should be rewritten in future.
Regarding the clean_cache.py script, I sthink it should be moved to
lib/
, or even better mergedinto
cache.py