From 2f40aa3743d2673faa99ee9a72130429374c577f Mon Sep 17 00:00:00 2001 From: Brian Joseph Petro Date: Mon, 8 Jul 2024 22:03:29 -0400 Subject: [PATCH] prevent issues with large files --- smart-entities/smart_entities.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/smart-entities/smart_entities.js b/smart-entities/smart_entities.js index adf814d3..b9b5ff29 100644 --- a/smart-entities/smart_entities.js +++ b/smart-entities/smart_entities.js @@ -292,6 +292,11 @@ class SmartNotes extends SmartEntities { const timeoutDuration = 10000; // Timeout duration in milliseconds (e.g., 10000 ms for 10 seconds) let i = 0; for(i = 0; i < files.length; i++){ + // if file size greater than 1MB skip + if(files[i].stat.size > 1000000){ + console.log("skipping large file: ", files[i].path); + continue; + } if(batch.length % 10 === 0){ this.env.main.notices.show('initial scan progress', [`Making Smart Connections...`, `Progress: ${i} / ${files.length} files`], { timeout: 0 }); // Promise.race to handle timeout