1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-13 16:25:44 +02:00

perf(backend): lazy load systeminformation

systeminformationを必要とする機能を有効にしていないサーバーで無駄に読み込まれることが無いように
This commit is contained in:
syuilo
2025-12-18 20:05:20 +09:00
parent dba44daf9c
commit baeed4bc80
5 changed files with 10 additions and 10 deletions

View File

@@ -7,7 +7,6 @@ import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
import { Injectable } from '@nestjs/common';
import si from 'systeminformation';
import { Mutex } from 'async-mutex';
import fetch from 'node-fetch';
import { bindThis } from '@/decorators.js';
@@ -84,6 +83,7 @@ export class AiService {
@bindThis
private async getCpuFlags(): Promise<string[]> {
const si = await import('systeminformation');
const str = await si.cpuFlags();
return str.split(/\s+/);
}