From 7b2c54f6a6a58263a17887dd9fef445d32d2fcfa Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 5 Nov 2022 12:14:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/system.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/back/services/system.ts b/back/services/system.ts index 47e8418b..5639dd2a 100644 --- a/back/services/system.ts +++ b/back/services/system.ts @@ -9,6 +9,7 @@ import ScheduleService from './schedule'; import { spawn } from 'child_process'; import SockService from './sock'; import got from 'got'; +import { promiseExec } from '../config/util'; @Service() export default class SystemService { @@ -87,10 +88,9 @@ export default class SystemService { let lastVersion = ''; let lastLog = ''; try { - const result = await got.get(config.lastVersionFile, { - timeout: 30000, - }); - const lastVersionFileContent = result.body; + const lastVersionFileContent = await promiseExec( + `curl ${config.lastVersionFile}`, + ); lastVersion = lastVersionFileContent.match(versionRegx)![1]; lastLog = lastVersionFileContent.match(logRegx) ? lastVersionFileContent.match(logRegx)![1]