修复启动时依赖配置未初始化

This commit is contained in:
whyour
2024-01-24 22:55:21 +08:00
parent 0a723318a1
commit 7f3e60423b
2 changed files with 29 additions and 7 deletions
+6 -6
View File
@@ -126,7 +126,7 @@ export default class SystemService {
return { code: 200, data: info };
}
public async updateNodeMirror(info: SystemModelInfo, res: Response) {
public async updateNodeMirror(info: SystemModelInfo, res?: Response) {
const oDoc = await this.getSystemConfig();
await this.updateAuthDb({
...oDoc,
@@ -141,8 +141,8 @@ export default class SystemService {
command,
{
onStart: async (cp) => {
res.setHeader('QL-Task-Pid', `${cp.pid}`);
res.end();
res?.setHeader('QL-Task-Pid', `${cp.pid}`);
res?.end();
},
onEnd: async () => {
this.sockService.sendMessage({
@@ -177,7 +177,7 @@ export default class SystemService {
return { code: 200, data: info };
}
public async updateLinuxMirror(info: SystemModelInfo, res: Response) {
public async updateLinuxMirror(info: SystemModelInfo, res?: Response) {
const oDoc = await this.getSystemConfig();
await this.updateAuthDb({
...oDoc,
@@ -203,8 +203,8 @@ export default class SystemService {
command,
{
onStart: async (cp) => {
res.setHeader('QL-Task-Pid', `${cp.pid}`);
res.end();
res?.setHeader('QL-Task-Pid', `${cp.pid}`);
res?.end();
},
onEnd: async () => {
this.sockService.sendMessage({