File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def tags_cached?
4242 end
4343
4444 def cached_tags_path
45- ENV [ "FLUENT_PACKAGE_TAGS_PATH" ] ?
45+ ENV [ "FLUENT_PACKAGE_TAGS_PATH" ] ?
4646 ENV [ "FLUENT_PACKAGE_TAGS_PATH" ] : "#{ @tmp_dir } /fluent-package-tags.json"
4747 end
4848
@@ -51,20 +51,16 @@ def release_tags_url
5151 end
5252
5353 def fetch_tags
54- begin
55- if tags_cached?
56- yield JSON . parse ( File . open ( cached_tags_path ) . read )
57- else
58- URI . open ( release_tags_url ) do |resource |
59- File . open ( cached_tags_path , "w+" ) do |f |
60- json = resource . read
61- f . write ( json )
62- yield JSON . parse ( json )
63- end
54+ if tags_cached?
55+ yield JSON . parse ( File . open ( cached_tags_path ) . read )
56+ else
57+ URI . open ( release_tags_url ) do |resource |
58+ File . open ( cached_tags_path , "w+" ) do |f |
59+ json = resource . read
60+ f . write ( json )
61+ yield JSON . parse ( json )
6462 end
6563 end
66- rescue => e
67- @logger . error "Failed to fetch tags" , error : e
6864 end
6965 end
7066
@@ -176,6 +172,7 @@ def check_update_versions
176172 end
177173 end
178174 end
175+ ensure
179176 FileUtils . rm_rf ( @tmp_dir )
180177 end
181178
You can’t perform that action at this time.
0 commit comments