取消不必要打印;执行完就退出
This commit is contained in:
@@ -55,6 +55,7 @@ async function test() {
|
||||
*/
|
||||
async function main(args) {
|
||||
console.log("neteaseMusic Start fetch ...");
|
||||
const cycle = false // 是否循环
|
||||
while (true) {
|
||||
// // 删除脏数据
|
||||
// var affectedRows1 = await dbUtils.query(`DELETE FROM song_artist_relation WHERE song_id = 0 OR artist_id = 0`, []);
|
||||
@@ -64,23 +65,23 @@ async function main(args) {
|
||||
switch (args.utils) {
|
||||
case 'song':
|
||||
await songInfoUtils.fetchAll({ args: args });
|
||||
await sleepUtils.sleep(60 * 1000);
|
||||
cycle && await sleepUtils.sleep(60 * 1000);
|
||||
break;
|
||||
case 'album':
|
||||
await albumInfoUtils.fetchAll({ args: args });
|
||||
await sleepUtils.sleep(30 * 1000);
|
||||
cycle && await sleepUtils.sleep(30 * 1000);
|
||||
break;
|
||||
case 'artist':
|
||||
await artistInfoUtils.fetchAll({ args: args });
|
||||
await sleepUtils.sleep(30 * 1000);
|
||||
cycle && await sleepUtils.sleep(30 * 1000);
|
||||
break;
|
||||
case 'lyric':
|
||||
await lyricInfoUtils.fetchAll({ args: args });
|
||||
await sleepUtils.sleep(30 * 1000);
|
||||
cycle && await sleepUtils.sleep(30 * 1000);
|
||||
break;
|
||||
case 'comment':
|
||||
await commentUtils.fetchAll({ args: args });
|
||||
await sleepUtils.sleep(30 * 1000);
|
||||
cycle && await sleepUtils.sleep(30 * 1000);
|
||||
break;
|
||||
case 'playlist':
|
||||
await playlistUtils.fetchTop({ args: args });
|
||||
@@ -89,12 +90,17 @@ async function main(args) {
|
||||
|
||||
case 'assistant':
|
||||
await assistantUtils.updateWaitTable();
|
||||
await sleepUtils.sleep(20 * 1000);
|
||||
cycle && await sleepUtils.sleep(20 * 1000);
|
||||
break;
|
||||
default:
|
||||
console.log("utils参数不匹配,退出");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cycle) {
|
||||
console.log("完成!");
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user