Skip to content

Commit 4a5151c

Browse files
committed
Set manifest's maximum size to Andrew's recommendation
1 parent b3d748f commit 4a5151c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/std/cache_hash.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const base64_decoder = fs.base64_decoder;
1515
const BIN_DIGEST_LEN = 48;
1616
const BASE64_DIGEST_LEN = base64.Base64Encoder.calcSize(BIN_DIGEST_LEN);
1717

18+
const MANIFEST_FILE_SIZE_MAX = 50 * 1024 * 1024;
19+
1820
pub const File = struct {
1921
path: ?[]const u8,
2022
stat: fs.File.Stat,
@@ -150,8 +152,7 @@ pub const CacheHash = struct {
150152
};
151153
}
152154

153-
// TODO: Figure out a good max value?
154-
const file_contents = try self.manifest_file.?.inStream().readAllAlloc(self.alloc, 16 * 1024);
155+
const file_contents = try self.manifest_file.?.inStream().readAllAlloc(self.alloc, MANIFEST_FILE_SIZE_MAX);
155156
defer self.alloc.free(file_contents);
156157

157158
const input_file_count = self.files.items.len;

0 commit comments

Comments
 (0)