Commit ac8bf067 authored by Łukasz Nowak's avatar Łukasz Nowak

- simplify


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30837 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f1e7cca3
...@@ -41,17 +41,11 @@ TIME=0 ...@@ -41,17 +41,11 @@ TIME=0
while true while true
do do
SELECT="SELECT count(*) AS message_count FROM message;" MESSAGE_VALUE=`echo "SELECT count(*) AS message_count FROM message;" | mysql $MYSQL_OPT | grep -v message`
VALUE=`echo $SELECT | mysql $MYSQL_OPT | grep -v message` MESSAGE_QUEUE_VALUE=`echo "SELECT count(*) AS message_count FROM message_queue;" | mysql $MYSQL_OPT | grep -v message`
if [ "$VALUE" == "0" ] if [ "$MESSAGE_VALUE" == "0" -a "$MESSAGE_QUEUE_VALUE" == 0 ] ; then
then
SELECT="SELECT count(*) AS message_count FROM message_queue;"
VALUE=`echo $SELECT | mysql $MYSQL_OPT | grep -v message`
if [ "$VALUE" == "0" ]
then
exit 0 exit 0
fi fi
fi
sleep $INTERVAL; sleep $INTERVAL;
TIME="`expr $TIME + $INTERVAL`" TIME="`expr $TIME + $INTERVAL`"
if [ $TIME -gt $TIMEOUT ] if [ $TIME -gt $TIMEOUT ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment