vite_deleteelectron

This commit is contained in:
2026-08-09 21:02:10 +03:00
parent 5d2fc5773c
commit 4ba9dd8012
99 changed files with 7080 additions and 48649 deletions
+7 -2
View File
@@ -4,9 +4,14 @@
const mysql = require('mysql2/promise'); // ✅ Используем promise-версию
const path = require('path');
const fs = require('fs-extra');
const fs = require('fs').promises;
const { logger } = require('./logger');
async function readJson(filePath) {
const data = await fs.readFile(filePath, 'utf8');
return JSON.parse(data);
}
// Загружаем переменные окружения
require('dotenv').config({ path: path.join(__dirname, '../../config.env') });
@@ -42,7 +47,7 @@ let isReconnecting = false;
async function checkTestMode() {
try {
const configPath = path.join(__dirname, '../../config.json');
const config = await fs.readJson(configPath);
const config = await readJson(configPath);
return config.testMode === true;
} catch (err) {
logger.warn('⚠️ Не удалось прочитать config.json для проверки testMode', { error: err.message });