1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

使用连接池;退出检查优化

This commit is contained in:
2022-10-01 19:45:49 +08:00
parent 074cbc124f
commit cf4449604d
7 changed files with 92 additions and 69 deletions

View File

@@ -1,10 +1,11 @@
const fs = require('fs');
const path = require('path');
const dbUtils = require('../../../utils/dbUtils');
const requestUtils = require('../../../utils/requestUtils');
const sleepUtils = require('../../../utils/sleepUtils');
const dbUtils = global.dbUtils;
// 获取专辑详情
async function fetch({ albumId }) {
let result = await dbUtils.query('SELECT count(*) as count FROM album WHERE album_id = ?', [albumId]);
@@ -95,7 +96,7 @@ async function fetch({ albumId }) {
image: albumInfo.image,
pub_date: albumInfo.pubDate,
company: albumInfo.company,
version: 4
version: 1
});
songIds.forEach(function (songId) {
if (isNaN(Number(songId)) || Number(songId) === 0 || isNaN(Number(albumId)) || Number(songId) === 0)

View File

@@ -1,10 +1,11 @@
const fs = require('fs');
const path = require('path');
const dbUtils = require('../../../utils/dbUtils');
const requestUtils = require('../../../utils/requestUtils');
const sleepUtils = require('../../../utils/sleepUtils');
const dbUtils = global.dbUtils;
// 获取音乐人详情
async function fetch({ artistId }) {
let result = await dbUtils.query('SELECT count(*) as count FROM artist WHERE artist_id = ?', [artistId]);

View File

@@ -1,10 +1,11 @@
const fs = require('fs');
const path = require('path');
const dbUtils = require('../../../utils/dbUtils');
const requestUtils = require('../../../utils/requestUtils');
const sleepUtils = require('../../../utils/sleepUtils');
const dbUtils = global.dbUtils;
// 获取音乐详情
async function fetch({ songId }) {
let result = await dbUtils.query('SELECT count(*) as count FROM song WHERE song_id = ?', [songId]);

View File

@@ -1,10 +1,11 @@
const fs = require('fs');
const path = require('path');
const dbUtils = require('../../../utils/dbUtils');
const requestUtils = require('../../../utils/requestUtils');
const sleepUtils = require('../../../utils/sleepUtils');
const dbUtils = global.dbUtils;
// 获取用户详情
async function fetch({ userId }) {
let url = `https://music.163.com/user/home?id=${userId}`;