mirror of
https://github.com/immich-app/immich.git
synced 2025-01-04 02:46:47 +01:00
Use APP_UPLOAD_LOCATION constant for diskInfo (#271)
This commit is contained in:
parent
40a8115101
commit
2e85e18020
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue