update
This commit is contained in:
@@ -7,13 +7,13 @@ const sleepUtils = require('../utils/sleepUtils');
|
|||||||
// 数据库连接池
|
// 数据库连接池
|
||||||
dbUtils.create({
|
dbUtils.create({
|
||||||
database: "neteaseMusic", // 指定数据库
|
database: "neteaseMusic", // 指定数据库
|
||||||
connectionLimit: 10, // 设置数据库连接池数量
|
connectionLimit: global.connectionLimit || 10, // 设置数据库连接池数量
|
||||||
});
|
});
|
||||||
global.dbUtils = dbUtils;
|
global.dbUtils = dbUtils;
|
||||||
console.log("global.useMysqlPool:", !!global.useMysqlPool);
|
console.log("global.useMysqlPool:", !!global.useMysqlPool);
|
||||||
|
|
||||||
// 两次请求之间停顿时间
|
// 两次请求之间停顿时间
|
||||||
global.sleepTime = 100;
|
global.sleepTime = 500;
|
||||||
|
|
||||||
// 引入utils
|
// 引入utils
|
||||||
const songInfoUtils = require('./src/getInfo/songInfoUtils');
|
const songInfoUtils = require('./src/getInfo/songInfoUtils');
|
||||||
@@ -52,7 +52,7 @@ async function main() {
|
|||||||
console.log(`删除脏数据 affectRows:`, affectRows1.affectedRows, affectRows2.affectedRows);
|
console.log(`删除脏数据 affectRows:`, affectRows1.affectedRows, affectRows2.affectedRows);
|
||||||
|
|
||||||
await songInfoUtils.fetchAll();
|
await songInfoUtils.fetchAll();
|
||||||
await albumInfoUtils.fetchAll();
|
await albumInfoUtils.fetchAll({});
|
||||||
await artistInfoUtils.fetchAll();
|
await artistInfoUtils.fetchAll();
|
||||||
await lyricInfoUtils.fetchAll();
|
await lyricInfoUtils.fetchAll();
|
||||||
await sleepUtils.sleep(2000);
|
await sleepUtils.sleep(2000);
|
||||||
|
3
watch.js
3
watch.js
@@ -1,4 +1,5 @@
|
|||||||
global.useMysqlPool = false;
|
global.useMysqlPool = true;
|
||||||
|
global.connectionLimit = 2;
|
||||||
const neteaseMusic = require('./netease_music/index');
|
const neteaseMusic = require('./netease_music/index');
|
||||||
neteaseMusic.watch();
|
neteaseMusic.watch();
|
||||||
setInterval(neteaseMusic.watch, 5000);
|
setInterval(neteaseMusic.watch, 5000);
|
Reference in New Issue
Block a user