From 861b720fc699e4c27b20fa36d312357982465f5a Mon Sep 17 00:00:00 2001 From: expressgy Date: Thu, 11 May 2023 17:35:51 +0800 Subject: [PATCH] s --- server.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/server.js b/server.js index 5c9315b..3b6e9ec 100644 --- a/server.js +++ b/server.js @@ -63,23 +63,24 @@ function back(){ // 开始备份数据库 function startBackSQL(){ - // 数据库信息 - let host = "localhost" - , user = "root" - , passwd = "root" - , database = "develop" - backSQL(host, user, passwd, database) - const outTime = getT() - new Date().getTime() + for(let item in DATABASELIST){ const i = DATABASELIST[item]; - database = i; - setTimeout(() => { - setInterval(() => { - backSQL(host, user, passwd, database) - }, 1000 * 60 * mintues) - },outTime) + console.log(i) + // 数据库信息 + let host = "localhost", user = "root", passwd = "root", database = i + runBackFunc(host, user, passwd, database) } } + function runBackFunc(host, user, passwd, database){ + backSQL(host, user, passwd, database) + const outTime = getT() - new Date().getTime() + setTimeout(() => { + setInterval(() => { + backSQL(host, user, passwd, database) + }, 1000 * 60 * mintues) + },outTime) + } /** * 根据系统类型,读取编码格式 * */