From 77d1ef354aabb55b74eb52ecfd9658607d1a81df Mon Sep 17 00:00:00 2001 From: David Goldwasser Date: Fri, 18 Oct 2024 15:57:24 -0600 Subject: [PATCH 1/2] fix issue#5274 so workflow does not remove contents from zip because of size --- src/workflow/Util.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/workflow/Util.cpp b/src/workflow/Util.cpp index e2df902b3f1..240aa04a565 100644 --- a/src/workflow/Util.cpp +++ b/src/workflow/Util.cpp @@ -266,12 +266,6 @@ void zipDirectory(const openstudio::path& dirPath, const openstudio::path& zipFi continue; } - auto dirSize = directorySize(dirEntryPath); - if (dirSize >= 15'000'000) { - LOG_FREE(Info, "openstudio.workflow.Util.zipDirectory", "Skipping too large directory " << dirEntryPath); - continue; - } - // TODO: do I need a helper like the workflow-gem was doing with add_directory_to_zip? zf.addDirectory(dirEntryPath, fs::relative(dirEntryPath, dirPath)); } else { @@ -279,10 +273,6 @@ void zipDirectory(const openstudio::path& dirPath, const openstudio::path& zipFi if ((ext.find(".zip") != std::string::npos) || (ext.find(".rb") != std::string::npos)) { continue; } - - if ((ext != ".osm") && (ext != ".idf") && (fs::file_size(dirEntryPath) > 100'000'000)) { - continue; - } zf.addFile(dirEntryPath, fs::relative(dirEntryPath, dirPath)); } } From d79e5f7262952af182d629a4c7808897841f0a10 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 29 Oct 2024 14:49:50 +0100 Subject: [PATCH 2/2] Remove unused lam ba --- src/workflow/Util.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/workflow/Util.cpp b/src/workflow/Util.cpp index 240aa04a565..f69b9e75ee3 100644 --- a/src/workflow/Util.cpp +++ b/src/workflow/Util.cpp @@ -246,17 +246,6 @@ void zipDirectory(const openstudio::path& dirPath, const openstudio::path& zipFi static constexpr std::array filterOutDirNames{"seed", "measures", "weather"}; - auto directorySize = [](const openstudio::path& dirPath) { - uintmax_t dirSize = 0; - for (const auto& dirEnt : fs::recursive_directory_iterator{dirPath}) { - const auto& dirEntryPath = dirEnt.path(); - if (fs::is_regular_file(dirEntryPath)) { - dirSize += fs::file_size(dirEntryPath); - } - } - return dirSize; - }; - for (const auto& dirEnt : fs::directory_iterator{dirPath}) { const auto& dirEntryPath = dirEnt.path(); if (fs::is_directory(dirEntryPath)) {