Skip to content

Commit

Permalink
depwatcher/httpd: remove all printing (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun024 authored Jul 3, 2024
1 parent a8194d0 commit 70df8fe
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions dockerfiles/depwatcher/src/depwatcher/httpd.cr
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,17 @@ module Depwatcher
retries = 0

while retries < max_retries
begin
sha_response = HTTP::Client.get("https://archive.apache.org/dist/httpd/httpd-#{ref}.tar.bz2.sha256")
if sha_response.status_code != 200
puts "Attempt #{retries + 1}: Received status #{sha_response.status_code}, retrying..."
retries += 1
sleep(5)
else
puts "Success: Received status 200"
break
end
rescue ex
puts "Failed with error: #{ex.message}, retrying..."
sha_response = HTTP::Client.get("https://archive.apache.org/dist/httpd/httpd-#{ref}.tar.bz2.sha256")
if sha_response.status_code != 200
retries += 1
sleep(5)
else
break
end
end

unless sha_response.nil?
sha256 = sha_response.body.split(" ")[0]
puts sha256
Release.new(ref, "https://dlcdn.apache.org/httpd/httpd-#{ref}.tar.bz2", sha256)
else
raise "Could not retreive the page after #{max_retries} attempts"
Expand Down

0 comments on commit 70df8fe

Please sign in to comment.