Skip to content

Commit

Permalink
add errno 812,issue # 4
Browse files Browse the repository at this point in the history
  • Loading branch information
zz090923610 committed Feb 1, 2016
1 parent 62c1bc3 commit aeb8dea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions files/usr/bin/fastdick
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ check_kill_exist_instance()
then
continue
fi
echo "Stop service fastdick $pid"
kill "$pid"
for cpid in [0-9]*
do
if grep "PPid: $pid" $cpid/status &>/dev/null
then
echo "Stop child process $cpid"
name=`cat $cpid/status | grep "Name:" | sed 's/Name://' | tr -d ' \n\t'`
if [ "$name" = "sleep" ]
then
Expand Down Expand Up @@ -291,29 +289,38 @@ speedup_result=$(speed_up_api "upgrade" "$userID" "$sessionID")
status=$(json_read "$speedup_result" "errno")
if [ "$status" -eq 0 ]
then
$(log "Speedup success")
is_speedup=1
else
$(log "Speedup failed, dump response json and exit")
is_speedup=0
$(log "$speedup_result")
$(json_dump "$speedup_result")
exit 1
fi
$(log "Speedup success")
is_speedup=1

elif [ "$status" -eq 812 ]
then
$(log "Already Speedup")
is_speedup=1
else
$(log "Speedup failed, dump response json and exit")
is_speedup=0
$(log "$speedup_result")
$(json_dump "$speedup_result")
exit 1
fi
while true; do
sleep 295
if [ "$loop" -eq 5 ]
then
$(flush_log)
loop=0
speedup_result=$(speed_up_api "recover" "$userID" "$sessionID")
sleep 5
sleep 10
speedup_result=$(speed_up_api "upgrade" "$userID" "$sessionID")
status=$(json_read "$speedup_result" "errno")
if [ "$status" -eq 0 ]
then
$(log "Re-speedup success")
is_speedup=1
is_speedup=1
elif [ "$status" -eq 812 ]
then
$(log "Already Speedup")
is_speedup=1
else
$(log "Re-speedup failed, dump response json, dump response json and exit")
$(log "$speedup_result")
Expand Down
Binary file modified thunder-fastdick_0.6-0_all.ipk
Binary file not shown.

0 comments on commit aeb8dea

Please sign in to comment.