| ... | ... | @@ -159,8 +159,6 @@ pub const CacheHash = struct { |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | const this_file = fs.cwd().openFile(cache_hash_file.path.?, .{ .read = true }) catch { |
| 162 | | self.manifest_file.?.close(); |
| 163 | | self.manifest_file = null; |
| 164 | 162 | return error.CacheUnavailable; |
| 165 | 163 | }; |
| 166 | 164 | defer this_file.close(); |
| ... | ... | @@ -213,8 +211,6 @@ pub const CacheHash = struct { |
| 213 | 211 | while (idx < input_file_count) : (idx += 1) { |
| 214 | 212 | var cache_hash_file = &self.files.items[idx]; |
| 215 | 213 | const contents = self.populate_file_hash(cache_hash_file) catch |err| { |
| 216 | | self.manifest_file.?.close(); |
| 217 | | self.manifest_file = null; |
| 218 | 214 | return error.CacheUnavailable; |
| 219 | 215 | }; |
| 220 | 216 | } |
| ... | ... | @@ -256,12 +252,7 @@ pub const CacheHash = struct { |
| 256 | 252 | var cache_hash_file = try self.files.addOne(); |
| 257 | 253 | cache_hash_file.path = try fs.path.resolve(self.alloc, &[_][]const u8{file_path}); |
| 258 | 254 | |
| 259 | | const contents = self.populate_file_hash_fetch(otherAlloc, cache_hash_file) catch |err| { |
| 260 | | self.manifest_file.close(); |
| 261 | | return err; |
| 262 | | }; |
| 263 | | |
| 264 | | return contents; |
| 255 | return try self.populate_file_hash_fetch(otherAlloc, cache_hash_file); |
| 265 | 256 | } |
| 266 | 257 | |
| 267 | 258 | /// Add a file as a dependency of process being cached, after the initial hash has been |
| ... | ... | @@ -317,6 +308,7 @@ pub const CacheHash = struct { |
| 317 | 308 | } |
| 318 | 309 | |
| 319 | 310 | self.manifest_file.?.close(); |
| 311 | |
| 320 | 312 | for (self.files.toSlice()) |*file| { |
| 321 | 313 | file.deinit(self.alloc); |
| 322 | 314 | } |