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) ;
}
}
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER