Update app.js

This commit is contained in:
wood chen 2024-09-09 21:32:47 +08:00 committed by GitHub
parent 037dbb7127
commit 8d9c0dfc87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,11 @@ import 'winston-daily-rotate-file';
import cluster from 'cluster';
import { cpus } from 'os';
import path from 'path';
import { fileURLToPath } from 'url';
// 处理 __dirname
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const numCPUs = cpus().length;