Skip to content

Commit

Permalink
added share/scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chubin committed Jun 15, 2020
1 parent ad0fcd6 commit 84a9ca3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions share/scripts/remove-from-cache.sh
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"

4 comments on commit 84a9ca3

@abitrolly
Copy link
Collaborator

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 similar bin/clean_cache.py

@chubin
Copy link
Owner Author

@chubin chubin commented on 84a9ca3 Nov 9, 2020

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?

@abitrolly
Copy link
Collaborator

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 than share/.

@chubin
Copy link
Owner Author

@chubin chubin commented on 84a9ca3 Nov 9, 2020

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 merged
into cache.py

Please sign in to comment.