Skip to content

Commit

Permalink
Error return in smax-init.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Dec 20, 2024
1 parent 786871f commit f9e6f9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions smax-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ load_script() {
SCRIPT=`cat $LUA/$NAME.lua`
SHA1=`redis-cli script load "$SCRIPT"`
redis-cli hset scripts $NAME $SHA1

if [ $? -ne 0 ] ; then
echo "ERROR! loading $NAME. Goodbye!"
exit 1
fi
}


load_script HGetWithMeta
load_script HSetWithMeta
load_script HMGetWithMeta
Expand Down
5 changes: 5 additions & 0 deletions smax-load-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ load_function() {
NAME=$1
echo -n "> Loading $NAME. New? "
`cat $LUA/$NAME | redis-cli function load replace`
if [ $? -ne 0 ] ; then
echo "ERROR! loading $NAME. Goodbye!"
exit 1
fi
}
load_function smax.lib
Expand Down

0 comments on commit f9e6f9f

Please sign in to comment.