Skip to content

Commit

Permalink
chore: propagate logger (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidejensen authored Aug 27, 2024
1 parent 6f0d50e commit 9cee89b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions consumer-server/src/logic/conversion-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export async function executeConversion(
printFolderSizes($PROJECT_PATH, logger)
logger.debug(`Full project size ${getFolderSize($PROJECT_PATH)}`)
logger.debug(`Filesystem folders over 1GB breakdown`)
printLargeFolders(getRootFolder())
printLargeFolders(getRootFolder(), logger)
printFolderSizes('/root/.cache/unity3d', logger)
}

Expand Down Expand Up @@ -456,12 +456,12 @@ function getRootFolder(): string {
}
}

function printLargeFolders(directoryPath: string, sizeLimit: number = 1024 * 1024 * 1024): void {
function printLargeFolders(directoryPath: string, logger: any, sizeLimit: number = 1024 * 1024 * 1024): void {
const files = fs.readdirSync(directoryPath)

for (const file of files) {
const filePath = path.join(directoryPath, file)

logger.debug(`filepath is ${filePath}`);

Check failure on line 464 in consumer-server/src/logic/conversion-task.ts

View workflow job for this annotation

GitHub Actions / install

Delete `;`
// Skip symbolic links to prevent infinite loops
if (isSymbolicLink(filePath)) {
continue
Expand All @@ -472,7 +472,7 @@ function printLargeFolders(directoryPath: string, sizeLimit: number = 1024 * 102
if (stats.isDirectory()) {
const folderSize = getFolderSize(filePath)
if (folderSize > sizeLimit) {
console.log(`${filePath}: ${(folderSize / (1024 * 1024)).toFixed(2)} MB`)
logger.debug(`filesystem folder at ${filePath}: ${(folderSize / (1024 * 1024)).toFixed(2)} MB`)
}
}
}
Expand Down

0 comments on commit 9cee89b

Please sign in to comment.