perf: 远程配下载与合并

pull/192/head
xiaojunnuo 2021-08-27 17:17:06 +08:00
parent 498c7cbec2
commit 296c5c15f0
3 changed files with 11 additions and 7 deletions

View File

@ -122,12 +122,17 @@ const configApi = {
if (get().app.remoteConfig.enabled !== true) {
return {}
}
const path = _getRemoteSavePath()
if (fs.existsSync()) {
const file = fs.readFileSync(path)
try {
const path = _getRemoteSavePath()
log.info('读取合并远程配置文件:', path)
return JSON5.parse(file.toString())
if (fs.existsSync(path)) {
const file = fs.readFileSync(path)
return JSON5.parse(file.toString())
}
} catch (e) {
log.info('远程配置读取有误', e)
}
return {}
},
/**

View File

@ -76,8 +76,7 @@ module.exports = {
},
'github.githubassets.com': {
'.*': {
proxy: 'assets.fastgit.org',
sni11: 'baidu.com'
proxy: 'assets.fastgit.org'
}
},
'customer-stories-feed.github.com': {

View File

@ -4,7 +4,7 @@
'github.githubassets.com': {
'.*': {
proxy: 'assets.fastgit.org',
sni11: 'baidu.com'
sni: null
}
}
},