1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
程序员小墨 2022-10-02 01:53:00 +08:00
parent 2ff2758fc8
commit d6c78a28bd
2 changed files with 5 additions and 4 deletions

View File

@ -7,13 +7,13 @@ const sleepUtils = require('../utils/sleepUtils');
// 数据库连接池
dbUtils.create({
database: "neteaseMusic", // 指定数据库
connectionLimit: 10, // 设置数据库连接池数量
connectionLimit: global.connectionLimit || 10, // 设置数据库连接池数量
});
global.dbUtils = dbUtils;
console.log("global.useMysqlPool:", !!global.useMysqlPool);
// 两次请求之间停顿时间
global.sleepTime = 100;
global.sleepTime = 500;
// 引入utils
const songInfoUtils = require('./src/getInfo/songInfoUtils');
@ -52,7 +52,7 @@ async function main() {
console.log(`删除脏数据 affectRows:`, affectRows1.affectedRows, affectRows2.affectedRows);
await songInfoUtils.fetchAll();
await albumInfoUtils.fetchAll();
await albumInfoUtils.fetchAll({});
await artistInfoUtils.fetchAll();
await lyricInfoUtils.fetchAll();
await sleepUtils.sleep(2000);

View File

@ -1,4 +1,5 @@
global.useMysqlPool = false;
global.useMysqlPool = true;
global.connectionLimit = 2;
const neteaseMusic = require('./netease_music/index');
neteaseMusic.watch();
setInterval(neteaseMusic.watch, 5000);