mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修改版本信息获取
This commit is contained in:
parent
23bda39812
commit
7b2c54f6a6
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue
Block a user