增加 update 服务

This commit is contained in:
whyour
2024-03-10 22:07:06 +08:00
parent cdeca4b808
commit 68ad01e0e8
11 changed files with 156 additions and 25 deletions
+1 -22
View File
@@ -329,28 +329,7 @@ export default class SystemService {
public async reloadSystem(target: 'system' | 'data') {
const cmd = `real_time=true ql reload ${target || ''}`;
const cp = spawn(cmd, { shell: '/bin/bash' });
cp.stdout.on('data', (data) => {
this.sockService.sendMessage({
type: 'reloadSystem',
message: data.toString(),
});
});
cp.stderr.on('data', (data) => {
this.sockService.sendMessage({
type: 'reloadSystem',
message: data.toString(),
});
});
cp.on('error', (err) => {
this.sockService.sendMessage({
type: 'reloadSystem',
message: JSON.stringify(err),
});
});
cp.unref();
return { code: 200 };
}