Fix bad detection & server option load after need

This commit is contained in:
Knah Tsaeb 2016-12-12 15:55:31 +01:00
parent c2e85e24ec
commit 1752eff2d9

View file

@ -22,13 +22,18 @@ log=false # log all generation success and error
randomSleep=`echo $((RANDOM%40))` randomSleep=`echo $((RANDOM%40))`
optimizeTool='' # external tool form optimize png optimizeTool='' # external tool form optimize png
maxQueue=50 # max process in queue maxQueue=50 # max process in queue
currentProcess=$(ps x | grep -v grep | grep thumb_server.sh | wc -l) currentProcess=$(ps ax | grep -v grep | grep thumb_server.sh | wc -l)
firstLevel=${hashUrl:0:2} firstLevel=${hashUrl:0:2}
secondLevel=${hashUrl:2:2} secondLevel=${hashUrl:2:2}
startPath=$sizeNameDir/$firstLevel/$secondLevel/ startPath=$sizeNameDir/$firstLevel/$secondLevel/
getArch=$(getconf LONG_BIT) getArch=$(getconf LONG_BIT)
#echo $getArch #echo $getArch
if [ -f "../cache/config/serverOptions.php" ]
then
source "../cache/config/serverOptions.php"
fi
if [ $currentProcess -gt $maxQueue ] if [ $currentProcess -gt $maxQueue ]
then then
rm "../cache/tmp/$hashUrl.lock" rm "../cache/tmp/$hashUrl.lock"
@ -43,11 +48,6 @@ fi
mkdir -p "../cache/img/$startPath" mkdir -p "../cache/img/$startPath"
if [ -f "../cache/config/serverOptions.php" ]
then
source "../cache/config/serverOptions.php"
fi
if [ ! $waitForResult ] if [ ! $waitForResult ]
then then
sleep $randomSleep sleep $randomSleep