优化下载 pac.txt 文件逻辑。
parent
2975e57716
commit
31733975b3
|
@ -80,7 +80,7 @@ function savePacFile (pacTxt) {
|
||||||
// 异步下载 pac.txt ,避免影响代理服务的启动速度
|
// 异步下载 pac.txt ,避免影响代理服务的启动速度
|
||||||
async function downloadPacAsync (pacConfig) {
|
async function downloadPacAsync (pacConfig) {
|
||||||
const remotePacFileUrl = pacConfig.pacFileUpdateUrl
|
const remotePacFileUrl = pacConfig.pacFileUpdateUrl
|
||||||
log.info('开始下载远程 pac.txt from:', remotePacFileUrl)
|
log.info('开始下载远程 pac.txt 文件:', remotePacFileUrl)
|
||||||
request(remotePacFileUrl, (error, response, body) => {
|
request(remotePacFileUrl, (error, response, body) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
log.error('下载远程 pac.txt 文件失败, error:', error, ', response:', response, ', body:', body)
|
log.error('下载远程 pac.txt 文件失败, error:', error, ', response:', response, ', body:', body)
|
||||||
|
|
|
@ -31,7 +31,7 @@ module.exports = (serverConfig) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const overWallConfig = serverConfig.plugin.overwall
|
const overWallConfig = serverConfig.plugin.overwall
|
||||||
if (overWallConfig.pac) {
|
if (overWallConfig.pac && overWallConfig.pac.enabled) {
|
||||||
const pacConfig = overWallConfig.pac
|
const pacConfig = overWallConfig.pac
|
||||||
|
|
||||||
// 自动更新 pac.txt
|
// 自动更新 pac.txt
|
||||||
|
|
Loading…
Reference in New Issue