Skip to content

Commit

Permalink
Add timeout for hashes import job
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-suse committed Jan 25, 2024
1 parent dfefa83 commit 83cdac5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MirrorCache/Task/FolderHashesImport.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sub _run {
$hq_url = "http://" . $hq_url unless 'http' eq substr($hq_url, 0, 4);

my $mojo_url = Mojo::URL->new($hq_url);
my $res = Mojo::UserAgent->new->get($mojo_url, {'User-Agent' => 'MirrorCache/hashes_import'})->result;
my $res = Mojo::UserAgent->new->request_timeout(180)->connect_timeout(3)->get($mojo_url, {'User-Agent' => 'MirrorCache/hashes_import'})->result;
return $job->fail('Request to HEADQUARTER ' . $hq_url . ' failed, response code ' . $res->code)
if $res->code > 299;

Expand Down

0 comments on commit 83cdac5

Please sign in to comment.