Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make timeouts overridable per plugin
  • Loading branch information
sorear committed Nov 19, 2010
1 parent a0aa5b8 commit ad9fd17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common.pm
Expand Up @@ -38,11 +38,12 @@ was encountered.
=cut

my $lwp = LWP::UserAgent->new();
$lwp->timeout(10);
our $timeout = 10;
$lwp->env_proxy();

sub fetch_url {
my ($url) = @_;
$lwp->timeout($timeout);
my $response = $lwp->get($url);
if($response->is_success) {
return $response->content;
Expand Down

0 comments on commit ad9fd17

Please sign in to comment.