Skip to content

Commit 1805b02

Browse files
committed
fix(api): Final fixes for disk stats
1 parent 76d1066 commit 1805b02

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

apps/api/src/status/status.service.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ export class StatusService {
3131

3232
const folderSize = await this.getFolderSize()
3333

34-
const totalDiskUsed = disk.total - disk.available
35-
3634
const freePercentage = parseFloat(((disk.available / disk.total) * 100).toFixed(2))
37-
const usedPercentage = parseFloat(((folderSize / totalDiskUsed) * 100).toFixed(2))
38-
const sizePercentage = parseFloat((((totalDiskUsed - folderSize) / disk.total) * 100).toFixed(2))
35+
const usedPercentage = parseFloat(((folderSize / disk.total) * 100).toFixed(2))
36+
const sizePercentage = parseFloat((((disk.total - disk.available - folderSize) / disk.total) * 100).toFixed(2))
3937

4038
return {
4139
version: 'unknown', // TODO:: Get git tag

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,16 @@
2424
"lint": "nx workspace-lint && nx lint",
2525
"logs": "yarn pm2 logs",
2626
"nx": "nx",
27-
"start": "nx serve",
27+
"reload:prod": "yarn stop:prod && yarn start:prod",
2828
"setup": "pm2 install pm2-logrotate && yarn build",
29+
"start": "nx serve",
2930
"start:api": "nx serve api",
3031
"start:prod": "pm2 start ecosystem.config.js",
3132
"stop:prod": "pm2 stop ecosystem.config.js",
3233
"test": "nx test",
3334
"update": "nx migrate latest",
3435
"workspace-schematic": "nx workspace-schematic"
3536
},
36-
"resolutions": {
37-
"webtorrent": "0.108.6",
38-
"webtorrent-cli": "3.0.7",
39-
"wrtc": "0.4.5"
40-
},
4137
"dependencies": {
4238
"@hapi/joi": "17.1.1",
4339
"@nestjs/cli": "7.5.1",
@@ -91,5 +87,10 @@
9187
"ts-node": "~9.0.0",
9288
"tslint": "~6.1.3",
9389
"typescript": "~4.0.3"
90+
},
91+
"resolutions": {
92+
"webtorrent": "0.108.6",
93+
"webtorrent-cli": "3.0.7",
94+
"wrtc": "0.4.5"
9495
}
9596
}

0 commit comments

Comments
 (0)