feat: Clash 订阅仅缓存 proxies 数据

This commit is contained in:
xream
2024-12-27 21:55:13 +08:00
parent d9e4d814bb
commit a3ec98caa9
6 changed files with 49 additions and 4 deletions

View File

@@ -62,6 +62,7 @@ async function getFile(req, res) {
mergeSources,
ignoreFailedRemoteFile,
proxy,
noCache,
} = req.query;
let $options = {};
if (req.query.$options) {
@@ -113,6 +114,9 @@ async function getFile(req, res) {
ignoreFailedRemoteFile = decodeURIComponent(ignoreFailedRemoteFile);
$.info(`指定忽略失败的远程文件: ${ignoreFailedRemoteFile}`);
}
if (noCache) {
$.info(`指定不使用缓存: ${noCache}`);
}
const allFiles = $.read(FILES_KEY);
const file = findByName(allFiles, name);
@@ -128,6 +132,7 @@ async function getFile(req, res) {
ignoreFailedRemoteFile,
$options,
proxy,
noCache,
});
try {

View File

@@ -114,6 +114,10 @@ async function compareSub(req, res) {
sub.ua,
undefined,
sub.proxy,
undefined,
undefined,
undefined,
true,
);
} catch (err) {
errors[url] = err;
@@ -219,6 +223,10 @@ async function compareCollection(req, res) {
sub.ua,
undefined,
sub.proxy,
undefined,
undefined,
undefined,
true,
);
} catch (err) {
errors[url] = err;

View File

@@ -74,6 +74,7 @@ async function produceArtifact({
undefined,
awaitCustomCache,
noCache,
true,
);
} catch (err) {
errors[url] = err;
@@ -122,6 +123,7 @@ async function produceArtifact({
undefined,
awaitCustomCache,
noCache,
true,
);
} catch (err) {
errors[url] = err;
@@ -243,6 +245,7 @@ async function produceArtifact({
undefined,
undefined,
noCache,
true,
);
} catch (err) {
errors[url] = err;