MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / isLargeFile

Function isLargeFile

js/botasaurus-server-js/src/utils.ts:62–80  ·  view source on GitHub ↗
(filePath:string)

Source from the content-addressed store, hash-verified

60const FOUR_HUNDRED_MB = 400 * 1024 * 1024;
61
62function isLargeFile(filePath:string) {
63 try {
64 // Get file stats
65 const stats = statSync(filePath);
66 // Compare file size with limit
67 if(stats.size > MAX_SIZE_LIMIT){
68 return true
69 }
70
71 if (stats.size > FOUR_HUNDRED_MB && getTotalMemory() < FIVE_GB) {
72 return true;
73 }
74
75 return false;
76 } catch (err) {
77 console.error(err);
78 return false;
79 }
80}
81
82function isEmpty(x: any) {
83 return (

Callers 7

computeItemDetailsFunction · 0.90
finishParentTaskMethod · 0.90
readCleanSaveTaskMethod · 0.90
markTaskAsSuccessMethod · 0.90

Calls 1

getTotalMemoryFunction · 0.85

Tested by

no test coverage detected