mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-16 02:37:19 +08:00
chore: 同步远程配置输出更多日志
This commit is contained in:
parent
9bb4739d56
commit
962bcda9dd
@ -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": {
|
||||||
|
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user