From 5a1c6a362743882ba2923570c24f77f555a39504 Mon Sep 17 00:00:00 2001 From: LeRoyce Pearson Date: Thu, 30 Apr 2020 20:00:26 -0600 Subject: [PATCH] Set manifest's maximum size to Andrew's recommendation --- lib/std/cache_hash.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/std/cache_hash.zig b/lib/std/cache_hash.zig index 963614fa6b..bab72f8852 100644 --- a/lib/std/cache_hash.zig +++ b/lib/std/cache_hash.zig @@ -15,6 +15,8 @@ const base64_decoder = fs.base64_decoder; const BIN_DIGEST_LEN = 48; const BASE64_DIGEST_LEN = base64.Base64Encoder.calcSize(BIN_DIGEST_LEN); +const MANIFEST_FILE_SIZE_MAX = 50 * 1024 * 1024; + pub const File = struct { path: ?[]const u8, stat: fs.File.Stat, @@ -150,8 +152,7 @@ pub const CacheHash = struct { }; } - // TODO: Figure out a good max value? - const file_contents = try self.manifest_file.?.inStream().readAllAlloc(self.alloc, 16 * 1024); + const file_contents = try self.manifest_file.?.inStream().readAllAlloc(self.alloc, MANIFEST_FILE_SIZE_MAX); defer self.alloc.free(file_contents); const input_file_count = self.files.items.len;