chore: 同步远程配置输出更多日志

This commit is contained in:
xream 2024-01-07 17:44:03 +08:00
parent 9bb4739d56
commit 962bcda9dd
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.14.139", "version": "2.14.140",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -386,10 +386,12 @@ async function syncAllArtifacts(_, res) {
async function syncArtifact(req, res) { async function syncArtifact(req, res) {
let { name } = req.params; let { name } = req.params;
name = decodeURIComponent(name); name = decodeURIComponent(name);
$.info(`开始同步远程配置 ${name}...`);
const allArtifacts = $.read(ARTIFACTS_KEY); const allArtifacts = $.read(ARTIFACTS_KEY);
const artifact = findByName(allArtifacts, name); const artifact = findByName(allArtifacts, name);
if (!artifact) { if (!artifact) {
$.error(`找不到远程配置 ${name}`);
failed( failed(
res, res,
new ResourceNotFoundError( new ResourceNotFoundError(
@ -428,6 +430,7 @@ async function syncArtifact(req, res) {
$.write(allArtifacts, ARTIFACTS_KEY); $.write(allArtifacts, ARTIFACTS_KEY);
success(res, artifact); success(res, artifact);
} catch (err) { } catch (err) {
$.error(`远程配置 ${artifact.name} 发生错误: ${err}`);
failed( failed(
res, res,
new InternalServerError( new InternalServerError(