mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
增加 update 服务
This commit is contained in:
+1
-22
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user