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]