mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	Use APP_UPLOAD_LOCATION constant for diskInfo (#271)
This commit is contained in:
		
							parent
							
								
									40a8115101
								
							
						
					
					
						commit
						2e85e18020
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user