|
@@ -1,11 +1,12 @@
|
|
import { Injectable } from '@nestjs/common';
|
|
import { Injectable } from '@nestjs/common';
|
|
import { ServerInfoDto } from './dto/server-info.dto';
|
|
import { ServerInfoDto } from './dto/server-info.dto';
|
|
import diskusage from 'diskusage';
|
|
import diskusage from 'diskusage';
|
|
|
|
+import { APP_UPLOAD_LOCATION } from '../../constants/upload_location.constant';
|
|
|
|
|
|
@Injectable()
|
|
@Injectable()
|
|
export class ServerInfoService {
|
|
export class ServerInfoService {
|
|
async getServerInfo() {
|
|
async getServerInfo() {
|
|
- const diskInfo = await diskusage.check('./upload');
|
|
|
|
|
|
+ const diskInfo = await diskusage.check(APP_UPLOAD_LOCATION);
|
|
|
|
|
|
const usagePercentage = (((diskInfo.total - diskInfo.free) / diskInfo.total) * 100).toFixed(2);
|
|
const usagePercentage = (((diskInfo.total - diskInfo.free) / diskInfo.total) * 100).toFixed(2);
|
|
|
|
|