Skip to content
Snippets Groups Projects
Commit a2e02d2a authored by Mario's avatar Mario
Browse files

Trying again three times if a scan fails

parent 2d872981
No related branches found
No related tags found
No related merge requests found
......@@ -138,20 +138,41 @@ targetCharge=$(jq -j '.scan.target_charge' $SCANCFG)
ctrlFile="$SOBASE/configs/rd53a/$module_id/controller.json"
cnctFile="$SOBASE/configs/rd53a/$module_id/connectivity.json"
#ctrlFile="/home/mario/work/yr/configs/controller/emuCfg.json"
comm="$YARRBASE/bin/scanConsole -r $ctrlFile -c $cnctFile -p -t ${targetAmpOrCharge} ${targetToT} -s ${scanPath} -m 1 $localdbOpt $qcOpt -o $SOBASE/data/$SO_RUNNUMBER" #> /dev/null 2>1
echo "[ info ][sl] Calling Yarr's scanConsole"
echo "[ info ][sl] $comm"
# If Yarr fails, try again from the same scan, a maximum of 3 times.
max_reps=3
# run and time every scan (yarr time)
START_YR=$(date +%s.%N)
$comm
retval=$?
if [ $retval -ne 0 ]; then
exit $retval
fi
reps=0; retval=-1
while [ retval != 0 ]; do
((reps++))
$comm # call Yarr
retval=$?
if [ $retval -ne 0 ] && [ $reps -ge $max_reps ]; then
echo "[ warn ][sl] After three attempts, couldn't succesfully finish $scanName."
exit $retval
elif [ $retval -ne 0 ]; then
echo "[ warn ][sl] Got an error from Yarr. Trying $scanName again in 3s ..."
sleep 3
fi
done
elp=$(echo "$(date +%s.%N) - $START_YR" | bc)
echo -ne "$scanName $elp\n" >> $TIMEFILE
# stop taking data
if [[ $dcsMonitor == 1 ]] ;then
echo "[ info ][sl] Stopping data taking"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment