mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 15:11:58 +00: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 { ServerInfoDto } from './dto/server-info.dto';
|
||||
import diskusage from 'diskusage';
|
||||
import { APP_UPLOAD_LOCATION } from '../../constants/upload_location.constant';
|
||||
|
||||
@Injectable()
|
||||
export class ServerInfoService {
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue