phantomjs memory leaks and restarting casperjs

130 views
Skip to first unread message

Mihai Bucica

unread,
Feb 13, 2015, 5:15:26 PM2/13/15
to casp...@googlegroups.com

Due to some well known bugs in phantomjs regardying memory leaks I am trying to create a bash script to restart my casperjs/phantomjs stuff when phantomjs crashes.....


cmd1="casperjs testCasper.js"

until $cmd1 >>$2; do

   echo "Server $cmd1 crashed with exit code $?. Respawning.."

   echo killall phantomjs

   sleep 5

 done


But somehow the phantomjs crashes dont get noticed and $cmd1 >>$2; have always the exit code of 0.

Does anyone have a working restarting casperjs script? Thanks,


Reply all
Reply to author
Forward
0 new messages