0

I have a problem I am hoping someone can help with I am running a perl script that calls a python script with a set of arguments as below

my $outText=`sudo /usr/bin/python /usr/local/bin/tacms/scriptname.py $pNumber $crnNumber`

The scriptname is supposed to process information based on the arguments passed and then give a terminal output which is saved in the variable, outText. There have been instances where this has failed and I suspect it is a timeout. So how would I increase the timeout period of the backticks

1 Answers1

0

yes, it was the script I was calling so what I did was say that if the results of $outText are null then repeat the whole process else continue...ie

my $outText=`sudo /usr/bin/python /usr/local/bin/tacms/scriptname.py $pNumber $crnNumber`

if ($outText eq ""){
    my $outText=`sudo /usr/bin/python /usr/local/bin/tacms/scriptname.py $pNumber $crnNumber`;
    //use variable here;
    }
else{
        //use variable here;
        }

At least this way my system would retry at least once before it fails. That was the best solution I could come up with. The python script being called was calling a web service in SOAP so sometimes, it would timeout.