Link to home
Start Free TrialLog in
Avatar of mybluegrass
mybluegrass

asked on

LWP::Simple no timeout

Hi, I'm trying to call a webservice through perl script's LWP::Simple. The webservice may take a long time to respond. I want to avoid timeout issue. Is there a way to set no timeout for LWP::Simple? Will the following work? Thanks! -Ming

while (my $fileid = <FILE>) {
        chomp $fileid;
       $ua->timeout(7200);
        my $html = get("http://myurl/cmWebServices/cmImport?fileID=$fileid");
        if ( ! defined $html ) {
            $errorLog->error("$fileid failed");
        } else {
            my $end = Time::HiRes::gettimeofday();
            my $logString = $fileid . "\t" . sprintf("%.4f\n", $end-$start);
            $infoLog->info($logString);
        }
    }
 
ASKER CERTIFIED SOLUTION
Avatar of point_pleasant
point_pleasant
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mybluegrass
mybluegrass

ASKER

You are right. It's not perl problem. It's the backend tomcat server thread timeout. Thanks!