Updated several dependencies including: - @aws-sdk/client-s3 from 3.965.0 to 3.975.0 - @aws-sdk/client-ses from 3.965.0 to 3.975.0 - @aws-sdk/client-sqs from 3.965.0 to 3.975.0 - dotenv from ^16.6.1 to ^16.5.0 - form-data from ^4.0.2 to ^4.0.5 - typescript from 5.9.3 to 5.8.3 Removed unused files: - backend/.yarn/releases/yarn-4.9.1.cjs - backend/package-lock.json
23 lines
663 B
TypeScript
23 lines
663 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { ConfigService } from '@nestjs/config';
|
|
import { writeSnapshot } from 'heapdump';
|
|
|
|
import { DateUtil } from '@/common';
|
|
|
|
import { SupportConfig } from '../config';
|
|
|
|
@Injectable()
|
|
export class HeapdumpService {
|
|
private readonly _config: SupportConfig | undefined;
|
|
|
|
constructor(private readonly configService: ConfigService) {
|
|
this._config = this.configService.get<SupportConfig>('support');
|
|
}
|
|
|
|
public async writeSnapshot(code: string) {
|
|
if (this._config?.accessCode && this._config.accessCode === code) {
|
|
writeSnapshot(`heapdump-${DateUtil.now().toISOString()}.heapsnapshot`);
|
|
}
|
|
}
|
|
}
|