axcwg 6 月之前
父节点
当前提交
5f743f1bee
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      main.js

+ 7 - 1
main.js

@@ -3,9 +3,15 @@ const express = require('express');
 const app = express();
 const app_serve = express();
 const mysql = require('mysql2')
+const pool = mysql.createPool({
+    keepAliveInitialDelay: 10000,
+    enableKeepAlive: true,
+
+})
 const db = mysql.createConnection({
-    host: 'mc.andyxie.cn', user: 'instrunet', password: 'Moyingren2015', database: "instrunet_data"
+    host: 'mc.andyxie.cn', user: 'instrunet', password: 'Moyingren2015', database: "instrunet_data", pool: pool
 })
+
 const bodyParser = require("body-parser");
 const nrc = require('node-run-cmd')
 const https = require("node:https");