取消不必要打印;执行完就退出
This commit is contained in:
		@@ -93,7 +93,7 @@ async function fetch({ songId }) {
 | 
			
		||||
        // console.log(commentInfoList);
 | 
			
		||||
        // console.log(userInfoList);
 | 
			
		||||
 | 
			
		||||
        console.log("dataManager.comment.insertCollection & dataManager.user.insertCollection")
 | 
			
		||||
        // console.log("dataManager.comment.insertCollection & dataManager.user.insertCollection")
 | 
			
		||||
        let p1 = dataManager.comment.insertCollection(commentInfoList.map(commentInfo => [
 | 
			
		||||
            commentInfo.comment_id,
 | 
			
		||||
            commentInfo.parent_comment_id,
 | 
			
		||||
@@ -145,7 +145,7 @@ async function fetch({ songId }) {
 | 
			
		||||
            current_status: progress.currentStatus,
 | 
			
		||||
            total: progress.total,
 | 
			
		||||
        };
 | 
			
		||||
        console.log("dataManager.comment_progress.update")
 | 
			
		||||
        // console.log("dataManager.comment_progress.update")
 | 
			
		||||
        let p3 = dataManager.comment_progress.update(commentProgressInfo, songId);
 | 
			
		||||
        // console.log("UPDATE comment_progress");
 | 
			
		||||
        await p3
 | 
			
		||||
 
 | 
			
		||||
@@ -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